Standard Action not working even though Table Actions do
What I am trying to do:
Display a standard filament button/action on the page that runs specific logic
What I did:
The button correctly renders, however, clicking on it does not run any action / load any modal. A network request is successfully sent but no more. No code within
Just to re-iterate, the table action works perfectly!
Code:
Livewire full page component
blade
Display a standard filament button/action on the page that runs specific logic
What I did:
- Following https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component
- Added both interfaces (HasForms, HasActions), and both traits (InteractsWithForms, InteractsWithActions)
- Created the action method that returns the Action
- Rendered the property within my blade view
{{ $this->testAction }} - Tested a Filament table action with the same action logic on the same page. This works fine.
- Double checked the correct Action is used
use Filament\Actions\Action; - Tested a form action, confirmation modal, single action. All same result
The button correctly renders, however, clicking on it does not run any action / load any modal. A network request is successfully sent but no more. No code within
->action(fn()=>foobar()) is triggered nor a form is displayed with ->form(...)Just to re-iterate, the table action works perfectly!
Code:
Livewire full page component
blade
Solution
make(‘testAction’) the function and the action name have to match. You can use ->label() to change the text.