Overview

Table Actions
Watch the Rapid Laravel Development with Filament series on Laracasts - it will teach you the basics of adding actions to Filament resource tables.Row actions
Action buttons can be rendered at the end of each table row. You can put them in the$table->actions() method:
make() method, passing its unique name.
You can then pass a function to action() which executes the task, or a function to url() which creates a link:
$record that was clicked.
Positioning row actions before columns
By default, the row actions in your table are rendered in the final cell of each row. You may move them before the columns by using theposition argument:
Positioning row actions before the checkbox column
By default, the row actions in your table are rendered in the final cell of each row. You may move them before the checkbox column by using theposition argument:
Accessing the selected table rows
You may want an action to be able to access all the selected rows in the table. Usually, this is done with a bulk action in the header of the table. However, you may want to do this with a row action, where the selected rows provide context for the action. For example, you may want to have a row action that copies the row data to all the selected records. To force the table to be selectable, even if there aren’t bulk actions defined, you need to use theselectable() method. To allow the action to access the selected records, you need to use the accessSelectedRecords() method. Then, you can use the $selectedRecords parameter in your action to access the selected records:
Bulk actions
Tables also support “bulk actions”. These can be used when the user selects rows in the table. Traditionally, when rows are selected, a “bulk actions” button appears in the top left corner of the table. When the user clicks this button, they are presented with a dropdown menu of actions to choose from. You can put them in the$table->bulkActions() method:
make() method, passing its unique name. You should then pass a callback to action() which executes the task:
$records that are selected. It is an Eloquent collection of models.
Grouping bulk actions
You may use aBulkActionGroup object to group multiple bulk actions together in a dropdown. Any bulk actions that remain outside the BulkActionGroup will be rendered next to the dropdown’s trigger button:
groupedBulkActions() method:
Deselecting records once a bulk action has finished
You may deselect the records after a bulk action has been executed using thedeselectRecordsAfterCompletion() method:
Disabling bulk actions for some rows
You may conditionally disable bulk actions for a specific record:Preventing bulk-selection of all pages
TheselectCurrentPageOnly() method can be used to prevent the user from easily bulk-selecting all records in the table at once, and instead only allows them to select one page at a time:
Header actions
Both row actions and bulk actions can be rendered in the header of the table. You can put them in the$table->headerActions() method:
Column actions
Actions can be added to columns, such that when a cell in that column is clicked, it acts as the trigger for an action. You can learn more about column actions in the documentation.Prebuilt table actions
Filament includes several prebuilt actions and bulk actions that you can add to a table. Their aim is to simplify the most common Eloquent-related actions:Grouping actions
You may use anActionGroup object to group multiple table actions together in a dropdown:
Choosing an action group button style
Out of the box, action group triggers have 3 styles - “button”, “link”, and “icon button”. “Icon button” triggers are circular buttons with an icon and no label. Usually, this is the default button style, but you can use it manually with theiconButton() method:
button() method:
link() method:
Setting the action group button icon
You may set the icon of the action group button using theicon() method:
Setting the action group button color
You may set the color of the action group button using thecolor() method:
Setting the action group button size
Buttons come in 3 sizes -sm, md or lg. You may set the size of the action group button using the size() method:
Setting the action group tooltip
You may set the tooltip of the action group using thetooltip() method:
Table action utility injection
All actions, not just table actions, have access to many utilities within the vast majority of configuration methods. However, in addition to those, table actions have access to a few more:Injecting the current Eloquent record
If you wish to access the current Eloquent record of the action, define a$record parameter:
$record, as they are not related to any table row.
Injecting the current Eloquent model class
If you wish to access the current Eloquent model class of the table, define a$model parameter:
Injecting the current table instance
If you wish to access the current table configuration instance that the action belongs to, define a$table parameter: