F
Filament3mo ago
Klavan

Public method [mountAction] not found on component when adding an action to Livewire component.

Hi. I'm trying to add an action to Livewire component like mentioned in documentation : https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component. I've got the following error : Unable to call component method. Public method [mountAction] not found on component. public function goLiveAction(): Action { return Action::make('goLiveAction') ->label('Passer en production') ->requiresConfirmation() ->modalWidth('lg') ->modalHeading('Passage en Production') ->action(function () { }) ->hidden(fn() => $this->merchant->in_live_mode); } <x-page.merchant :$merchant :breadcrumbs="$this->breadcrumbs"> <x-slot:headerActions> @if ($this->goLiveAction->isVisible()) {{ $this->goLiveAction }} @endif </x-slot:headerActions> <x-filament-actions::modals/> </x-page.merchant>
3 Replies
Daniel Reales
Daniel Reales2w ago
Same here! Were you able to do this?
awcodes
awcodes2w ago
Code looks ok. Make sure you are importing all the necessary traits and interfaces and that your view is also including the modals component.
Daniel Reales
Daniel Reales2w ago
You were right, I needed to add the traits and interfaces. Thanks!

Did you find this page helpful?