> ## Documentation Index
> Fetch the complete documentation index at: https://inertiajs-datatables.eklundlabs.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions

### Adding Actions

To add an action to your table, define it within the `actions` method.
Action buttons are displayed on the far right side of each row.

```php theme={null}
class Users extends Table
{
    protected ?string $resource = User::class;

    public function actions(): array
    {
        return [
            Action::make('Wave', fn (User $user) => logger("Hello user {$user->name}"))
        ];
    }
}
```

### Bulk Actions

By default, an action processes only the row to which it belongs. However, actions can be marked as bulk actions, allowing them to be executed on multiple selected rows at once.

```php theme={null}
Action::make('Wave', fn (User $user) => logger("Hello user {$user->name}"))
    ->asBulk()
```

### Links

In some cases, you may want to add an “Edit” or other link for each row. This is where `asLink` becomes useful.
When an action is marked with `asLink`, the custom response returned by the handler will be used.

```php theme={null}
Action::make('Edit', fn (User $user) => redirect()->route('users.show', $user))
    ->asLink()
    ->icon('UserRoundPen')
```
