Getting started
Single actions
Single action buttons are rendered at the end of each table row. If you’re using the actions in a Livewire component, you can put them in thegetTableActions() method.
$table:
make() method, passing its name. The name of the action should be unique. You can then pass a callback to action() which executes the task, or a callback to url() which generates a link URL:
If you would like the URL to open in a new tab, you can use the openUrlInNewTab() method.
Bulk actions
Bulk action buttons are visible when the user selects at least one record. If you’re using the actions in a Livewire component, you can put them in thegetTableBulkActions() method.
$table:
make() method, passing its name. The name of the action should be unique. You should then pass a callback to action() which executes the task:
Please note that Filament uses the parameter name $records in the function to inject the collection. Any other parameter name will resolve from the container instead.
You may deselect the records after a bulk action has been executed using the deselectRecordsAfterCompletion() method:
Setting a label
By default, the label of the action is generated from its name. You may customize this using thelabel() method:
translateLabel() method:
Setting a color
Actions may have a color to indicate their significance. It may be eitherprimary, secondary, success, warning or danger:
Disabling record bulk actions
You may conditionally disable bulk actions for a specific record:Setting a size
The default size for table actions issm but you may also change it to either md or lg:
Setting an icon
Bulk actions and some single actions may also render a Blade icon component to indicate their purpose:Modals
Actions and bulk actions may require additional confirmation or form information before they run. With the table builder, you may open a modal before an action is executed to do this.Confirmation modals
You may require confirmation before an action is run using therequiresConfirmation() method. This is useful for particularly destructive actions, such as those that delete records.
Note: The confirmation modal is not available when aurl()is set instead of anaction(). Instead, you should redirect to the URL within theaction()callback.
Custom forms
You may also render a form in this modal to collect extra information from the user before the action runs. You may use components from the Form Builder to create custom action modal forms. The data from the form is available in the$data array of the action() callback:
Filling default data
You may fill the form with default data, using themountUsing() method:
Wizards
You may easily transform action forms into multistep wizards. On the action, simply pass in the wizard steps to thesteps() method, instead of form():
Setting a modal heading, subheading, and button label
You may customize the heading, subheading and button label of the modal:Custom content
You may define custom content to be rendered inside your modal, which you can specify by passing a Blade view into themodalContent() method:
modalFooter() if you wish:
Authorization
You may conditionally show or hide actions and bulk actions for certain users using either thevisible() or hidden() methods, passing a closure:
Prebuilt actions
Replicate
This package includes an action to replicate table records. You may use it like so:excludeAttributes() method is used to instruct the action which columns to be excluded from replication:
beforeReplicaSaved() method can be used to invoke a Closure before saving the replica:
afterReplicaSaved() method can be used to invoke a Closure after saving the replica:
Retrieving user input
Just like normal actions, you can provide a form schema that can be used to modify the replication process:Grouping
You may use anActionGroup object to group multiple table actions together in a dropdown:
Position
By default, the row actions in your table are rendered in the final cell. You may change the position by overriding thegetTableActionsPosition() method:
Alignment
Row actions are aligned to the right in their cell by default. To change the alignment, update the configuration value inside of the package config:Tooltips
If you want to use tooltips outside of the admin panel, make sure you haveYou may specify a tooltip to display when you hover over an action:@ryangjchandler/alpine-tooltipinstalled in your app, includingtippy.css. You’ll also need to installtippy.cssif you’re using a custom admin theme.