F
Filament11mo ago
_kuding

Custom page Action with kebab-case doesn't activate

Custom page actions (not table actions, they work as expected) that have kebab-case name (Action::make('test-text')) won't trigger it's action on click. When it changed to Action::make('testText'), it works as expected.
public function testTextAction(): Action
{
return Action::make('test-text')
->requiresConfirmation()
->action(function () {
// action
});
}
public function testTextAction(): Action
{
return Action::make('test-text')
->requiresConfirmation()
->action(function () {
// action
});
}
{{ $this->testTextAction }}
{{ $this->testTextAction }}
1 Reply
Hasnayeen
Hasnayeen11mo ago
Function names use underscores between words, while class names use both the camelCase and PascalCase rules.
Check the rules for function naming convention https://www.php.net/manual/en/userlandnaming.rules.php