Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

masicek159's avatar

Laravel Nova 4 - Trigger custom nova action from custom card

I would like to trigger the Laravel Nova custom action from a custom card. I have created custom action according to the documentation. Then I have registered the action in the resource actions. Also, I have created custom card, which I have also added into resource cards. I would like to run the custom action from the card when pressing button. I have tried using following code in Card.vue (when pressing the button):

Nova.$emit('custom-action', {'arg1': 'arg'})

In the action class, I have added listener as follows:

public function listen()
    {
        return [
            'custom-action' => 'handle',
        ];
    }

And I have also defined handle function, which is not important at the moment:

public function handle(ActionFields $fields, Collection $models)
    {
        return Action::message('Here');
    }

The button, however, does not trigger anything. Some help would be appreciated.

0 likes
1 reply

Please or to participate in this conversation.