Actions
Introduction
Filament's tables can use Actions. They are buttons that can be added to the end of any table row, or even in the header or toolbar of a table. For instance, you may want an action to "create" a new record in the header, and then "edit" and "delete" actions on each row. Bulk actions can be used to execute code when records in the table are selected. Additionally, actions can be added to any table column, such that each cell in that column is a trigger for your action.
It's highly advised that you read the documentation about customizing action trigger buttons and action modals to that you are aware of the full capabilities of actions.
Record actions
Action buttons can be rendered at the end of each table row. You can put them in the $table->recordActions() method:
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
->recordActions([
// ...
]);
}
Actions may be created using the static 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:
use App\Models\Post;
use Filament\Actions\Action;
Action::make('edit')
->url(fn (Post $record): string => route('posts.edit', $record))
->openUrlInNewTab()
Action::make('delete')
->requiresConfirmation()
->action(fn (Post $record) => $record->delete())
All methods on the action accept callback functions, where you can access the current table $record that was clicked.

Positioning record actions before columns
By default, the record actions in your table are rendered in the final cell of each row. You may move them before the columns by using the position argument:
use Filament\Tables\Enums\RecordActionsPosition;
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
->recordActions([
// ...
], position: RecordActionsPosition::BeforeColumns);
}

Positioning record actions before the checkbox column
By default, the record actions in your table are rendered in the final cell of each row. You may move them before the checkbox column by using the position argument:
use Filament\Tables\Enums\RecordActionsPosition;
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
->recordActions([
// ...
], position: RecordActionsPosition::BeforeCells);
}



