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

tomcodes's avatar

Allow actions according to a model attribute when selecting multiple items

I am new to Nova and am working on actions on a resource called Card_request.

When I select multiple models in the frontend, I want to filter available actions depending on an attribute of the Card_request model, say when $cardRequest->type === 5.

It works fine when the user clicks only one model in the frontend. However as soon as I select another line in the table, the following actions() method on my Nova Resource does not work:

public function actions(NovaRequest $request)
{
    info($this->model()->type);
    return [
        (new Actions\ResendCard)->canSee(function () {
                return $this->model()->type === 5;
            })
            ->showInline(),
    ];
}

I got an empty log whenever I select multiple items in the table.

Is there a way to achieve this? If yes, I'd really be curious to know how, thank you!

0 likes
0 replies

Please or to participate in this conversation.