Skip to main content
The Action class is the foundation for all interactive operations in Filament. Actions can open modals, execute callbacks, redirect users, and more. They’re used throughout tables, forms, pages, and other components.

Namespace

Inheritance

Extends: Filament\Support\Components\ViewComponent Implements: Arrayable

Static Methods

make()

Create a new action instance.
string | null
The unique identifier for this action. If null, uses the default name from getDefaultName().
static
Returns the action instance for method chaining.
Example:

getDefaultName()

Get the default name for the action.
string | null
Returns the default name or null.

fromArray()

Create an action from an array representation.
array<string, mixed>
The array data to create the action from.
static
Returns the configured action instance.

Display Methods

label()

Set the action label.
string | Htmlable | Closure | null
The label text to display.
static
Returns the action instance for method chaining.

icon()

Set the action icon.
string | Closure | null
The icon identifier (e.g., ‘heroicon-o-pencil’).
static
Returns the action instance for method chaining.

color()

Set the action color.
string | array | Closure | null
The color name or array of color values.
static
Returns the action instance for method chaining.
Example:

button()

Render the action as a button.
static
Returns the action instance for method chaining.

iconButton()

Render the action as an icon button (no label).
static
Returns the action instance for method chaining.
Render the action as a link.
static
Returns the action instance for method chaining.

badge()

Render the action as a badge.
string | int | float | Closure | null
The badge content. If no arguments are provided, renders as a badge view.
static
Returns the action instance for method chaining.

size()

Set the action size.
Size | string | Closure | null
The size (e.g., Size::Small, Size::Medium, Size::Large).
static
Returns the action instance for method chaining.

Behavior Methods

action()

Set the callback to execute when the action is triggered.
string | Closure | null
A closure to execute or a string method name.
static
Returns the action instance for method chaining.
Example:

requiresConfirmation()

Require confirmation before executing the action.
bool | Closure
default:"true"
Whether confirmation is required.
static
Returns the action instance for method chaining.
Example:

modalHeading()

Set the modal heading.
string | Htmlable | Closure | null
The modal heading text.
static
Returns the action instance for method chaining.

modalDescription()

Set the modal description.
string | Htmlable | Closure | null
The modal description text.
static
Returns the action instance for method chaining.

modalSubmitActionLabel()

Set the submit button label.
string | Htmlable | Closure | null
The submit button label.
static
Returns the action instance for method chaining.

form()

Add a form to the action modal.
array | Closure
An array of form components or a closure returning components.
static
Returns the action instance for method chaining.
Example:

URL and Redirect Methods

url()

Set a URL for the action.
string | Closure | null
The URL to navigate to.
bool | Closure
default:"false"
Whether to open the URL in a new tab.
static
Returns the action instance for method chaining.
Example:

redirect()

Redirect after the action executes.
string | Closure | null
The URL to redirect to after execution.
static
Returns the action instance for method chaining.

Notification Methods

successNotification()

Show a success notification after the action executes.
Notification | Closure | null
The notification instance or a closure returning a notification.
static
Returns the action instance for method chaining.
Example:

State Control

disabled()

Disable the action.
bool | Closure
default:"true"
Whether the action is disabled.
static
Returns the action instance for method chaining.

hidden()

Hide the action.
bool | Closure
default:"true"
Whether the action is hidden.
static
Returns the action instance for method chaining.
Example:

visible()

Show the action based on a condition.
bool | Closure
default:"true"
Whether the action is visible.
static
Returns the action instance for method chaining.

Authorization

authorize()

Set the authorization check.
bool | Closure
Whether the action is authorized.
static
Returns the action instance for method chaining.
Example:

Lifecycle Hooks

before()

Execute a callback before the action runs.
Closure
The callback to execute before the action.
static
Returns the action instance for method chaining.

after()

Execute a callback after the action runs.
Closure
The callback to execute after the action.
static
Returns the action instance for method chaining.
Example:

Special Methods

call()

Execute the action programmatically.
array<string, mixed>
default:"[]"
Parameters to pass to the action.
mixed
Returns the result of the action callback.

success()

Mark the action as successful.

failure()

Mark the action as failed.

halt()

Halt the action execution.
bool
default:"false"
Whether to roll back the database transaction.

cancel()

Cancel the action execution.
bool
default:"false"
Whether to roll back the database transaction.

Closure Parameters

Action closures automatically receive contextual parameters:
array
Action arguments passed from the frontend.
array
Form data from the action modal.
Component
The parent Livewire component.
Model | null
The Eloquent model instance.
Model | null
The current record (alias for model).
Collection
Selected records (for bulk actions).
Table | null
The table instance (for table actions).

View Constants