Skip to main content

Action context

The ActionContext is an object that is passed to all actions and all callbacks defined on actions. It knows the context of where the action is rendered, for instance if the action is rendered as a row action it will contain the model of the current row. And if an action is rendered inside a dropdown list, the context will know this as well.

Action context properties

PropertyTypeDescriptionOn table actionsOn bulk actionsOn row actions
$requestIlluminate\Http\RequestThe current request<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓
$configBrickNPC\EloquentTables\Services\ConfigThe configuration of the package<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓
$modelIlluminate\Database\Eloquent\ModelThe model of the current row<span style={{ color: 'red'}}>✗<span style={{ color: 'red'}}>✗<span style={{ color: 'green'}}>✓
$asDropdownboolIndicates if the action is rendered as part of a dropdown<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓
$isBulkboolIndicates if the action is rendered as a bulk action<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓<span style={{ color: 'green'}}>✓