A Laravel Nova field to run actions.

Installs: 324 319

Dependents: 2

Suggesters: 0

Security: 0

Stars: 35

Watchers: 2

Forks: 22

Open Issues: 13


v0.7.4 2021-10-09 13:32 UTC


Latest Version on Packagist Licence Total Downloads

This package allows you to execute an action directly on your resource table view.


composer require pdmfc/nova-action-button


use App\Nova\Actions\ChangeRole;
use Pdmfc\NovaFields\ActionButton;


public function fields()
    return [
            ->action(ChangeRole::class, $this->id)
            //->action(new ChangeRole(), $this->id) using a new instance

The action() method requires two params - the action class name or a new instance, and the target resource id.

Basic example

Disabling button

You can use the native Laravel nova readonly() method to prevent users from clicking the button:

    ->action(ChangeRole::class, $this->id)
    ->readonly(function () {
        return $this->role->name === 'admin';

Disabling the button

Change the button text

To edit the button text content, use the text() method.


Enable the loading animation on button and change color

To enable the loading animation on button and change color, use showLoadingAnimation() and loadingColor('#fff') method.

->loadingColor('#fff') # default is #000

Add a svg to the button

In order to add a svg to the button, you first need to create a vue component containing a svg and then pass the component name to the svg() method.


Change button color

To change button color, use buttonColor('#21b970') method.

->buttonColor('#21b970') # default is .btn-primary color


  • Currently, in order to use this field, you still have to declare the action in your resource actions() method.

How to contribute

  • clone the repo
  • on composer.json of a laravel nova application add the following:

    "require" {
        "pdmfc/nova-action-button: "*"

    "repositories": [
            "type": "path",
            "url": "../path_to_your_package_folder"
  • run composer update pdmfc/nova-action-button

You're now ready to start contributing!


Please see CHANGELOG for more information on what has changed recently.