Dec 25, 2021
0
Level 13
How to limit action nova to show only in showOnDetail
I need limit action to only one element.
I don't like user can select multiples register of model in index.
I've tried disable on index when declare in actions method, but get error
(new Actions\PrepareCampaign)->shownOnDetail()->canSee(function ($request) {
return $request instanceof ActionRequest
|| ($this->resource->exists && $this->resource->active === true);
})->canRun(function ($request, $model) {
return (int) $model->getKey() !== 1;
}),
I can filter action in handle counting elements of collection, but I prefer not show this actions in index page of resource.
Is possible ?
Please or to participate in this conversation.