laravel / nova-issues

554 stars 35 forks source link

canRun() method disable in the UI only first action from the array of actions #6127

Closed sunnydesign closed 8 months ago

sunnydesign commented 9 months ago

Description:

When we have more than one action and want to disallow all of them and disable in the UI by canRun() method, in the UI will disable only first action.

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Create two actions and disallow both of them (return false from the canRun callback) :
    public function actions(NovaRequest $request)
    {
        return [
            resolve(FirstAction::class)
                ->canRun(fn ($request, $building) => false),
            resolve(SecondAction::class)
                ->canRun(fn ($request, $building) => false),
        ];
    }
  1. See result. Peek 2023-12-22 12-15
davidhemphill commented 8 months ago

This has been fixed and will be included in the next release. 👍