action button in topbar
Hi! I'm trying to put an action button on the topbar, but nothing is happening when I click on the action.
My code is like this:
Livewire component:
Hook on the panel provider:
Solution:Jump to solution
Ah, it’s because the name of the action doesn’t match the output in the blade file.
Action::make(‘custom’)
{{ $this->customAction }}...
10 Replies
what in the view:
livewire.scan-action
try adding
<x-filament-actions::modals />
it's already like this
based on the code you shared, there's no
->action()
on the Action so, you're not telling it to actually do anything. 🙂Really, I would like to pass an view, where I would normally use
how would I do this?
ModalContent should work. The confirmation doesn’t make sense to me in that use case. 😀 but you can also do
->action(fn() => null)
if you need to.It still doesn't work, I put inside and it wasn't called,
code:
Which Action class did you import?
use Filament\Actions\Action;
Solution
Ah, it’s because the name of the action doesn’t match the output in the blade file.
Action::make(‘custom’)
{{ $this->customAction }}
EXACTLY THAT! thank you very much @awcodes 😀