1. Go to this page and download the library: Download pdmfc/nova-action-button library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pdmfc / nova-action-button example snippets
use App\Nova\Actions\ChangeRole;
use Pdmfc\NovaFields\ActionButton;
//...
public function fields()
{
return [
ActionButton::make('Action')
->action(ChangeRole::class, $this->id)
//->action(new ChangeRole(), $this->id) using a new instance
];
}