lednerb / nova-action-button-selectors
A Laravel Nova asset.
v2.0.6
2024-02-19 12:14 UTC
Requires
- php: ^7.3|^8.0
- laravel/nova: ~4.0
README
# Laravel Nova action button selector
This package allows you to add buttons for Nova actions on the detail page instead having them all within the dropdown menu.
This package is based on the original code from pitchayakit/nova-action-button-selector
but differs in usage:
Instead of automatically showing all actions as buttons, it allows you to add the ShowAsButton
trait to the actions you want to display as buttons.
Also it fixes some styling issues.
Requirements
php: ^8
laravel/nova: ^4
How to install
composer require lednerb/nova-action-button-selectors
Detail page
Index page with inline action
Usage
In your Action class define the following trait:
...
use Lednerb\ActionButtonSelector\ShowAsButton;
class MyAction extends Action
{
use InteractsWithQueue, Queueable;
use ShowAsButton;
...
If you want to hide the button on some Detail pages, use the following method in the Nova Model's actions
array:
...
public function actions(NovaRequest $request)
{
return [
MyCustomAction::make()
->onlyOnDetail()
->withoutConfirmation()
->showAsButton(false),
...