Skip to main content
You are currently viewing the documentation for Filament 2.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.

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 the getTableActions() method.
If you’re using them in admin panel resources or relation managers, you must put them on the $table:
Actions may be created using the static 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 the getTableBulkActions() method.
If you’re using them in admin panel resources or relation managers, you must put them on the $table:
Bulk actions may be created using the static 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 the label() method:
Optionally, you can have the label automatically translated by using the translateLabel() method:

Setting a color

Actions may have a color to indicate their significance. It may be either primary, 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 is sm 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 the requiresConfirmation() method. This is useful for particularly destructive actions, such as those that delete records.
Note: The confirmation modal is not available when a url() is set instead of an action(). Instead, you should redirect to the URL within the action() 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 the mountUsing() method:

Wizards

You may easily transform action forms into multistep wizards. On the action, simply pass in the wizard steps to the steps() 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 the modalContent() method:
By default, the custom content is displayed above the modal form if there is one, but you can add content below using modalFooter() if you wish:

Authorization

You may conditionally show or hide actions and bulk actions for certain users using either the visible() or hidden() methods, passing a closure:
This is useful for authorization of certain actions to only users who have permission.

Prebuilt actions

Replicate

This package includes an action to replicate table records. You may use it like so:
The excludeAttributes() method is used to instruct the action which columns to be excluded from replication:
The beforeReplicaSaved() method can be used to invoke a Closure before saving the replica:
The 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 an ActionGroup 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 the getTableActionsPosition() 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 have @ryangjchandler/alpine-tooltip installed in your app, including tippy.css. You’ll also need to install tippy.css if you’re using a custom admin theme.
You may specify a tooltip to display when you hover over an action:
This method also accepts a closure that can access the current table record: