Action buttons

Action Buttons

Action buttons are displayed when browsing a BREAD next to each row

You can add your own buttons very easily. First we will create an Action-class which extends Voyagers AbstractAction in app/Actions/MyAction.php

Next we need to tell Voyager that we want to use this action. For this open your app/Providers/AppServiceProvider.php and search for the boot() method

After that you will see your new button when browsing any BREAD

Showing/hiding actions

If you only want to show your action for special datatypes you can implement a function shouldActionDisplayOnDataType() in your action:

If you want to show your action-button on a per-row-base, simply implement a method shouldActionDisplayOnRow($row) and add your condition(s)

Mass Actions

Mass actions are called for multiple instances of a model. If you want your action to be a mass action, just implement the following method:

Last updated