#Action not triggering

2 messages · Page 1 of 1 (latest)

noble junco
#

I have a simple Livewire Component:

class UserIcon extends Component implements HasForms, HasActions
{
    use InteractsWithActions;
    use InteractsWithForms;


    public function userMenuOrLogin(): Action
    {
        return Action::make('login')
            ->action(function (array $arguments) {
                dd('Test action called', $arguments);
            });
    }


    public function render(): View
    {
        return view('livewire.user-icon');
    }
}

and thats the view:

<div>
    {{ $this->userMenuOrLogin }}
    <x-filament-actions::modals />
</div>

When I click on the button, I can see the update request on the network tab of chrome, but nothing happens, no DD output is shown. Any ideas?

minor dew
#

Your function name needs ‘Action’ and the name of the action itself needs to match.

function deleteAction()
Action::make(‘delete’)