> Source: https://laravilt.com/docs/actions/notifications

# Action Notifications

Provide feedback after action execution.

## Success Notification

```php
use Laravilt\Actions\Action;

Action::make('approve')
    ->action(fn ($record) => $record->approve())
    ->successNotificationTitle('Approved successfully');
```

## Custom Success Notification

```php
use Laravilt\Actions\Action;
use Laravilt\Notifications\Notification;

Action::make('process')
    ->action(fn ($record) => $record->process())
    ->successNotification(
        Notification::make()
            ->title('Processing complete')
            ->body('The record has been processed.')
            ->success()
    );
```

## Failure Notification

```php
use Laravilt\Actions\Action;

Action::make('process')
    ->action(function ($record) {
        if (!$record->canBeProcessed()) {
            throw new \Exception('Cannot process this record');
        }
        $record->process();
    })
    ->failureNotificationTitle('Processing failed');
```

## Manual Notification

```php
use Laravilt\Actions\Action;
use Laravilt\Notifications\Notification;

Action::make('publish')
    ->action(function ($record) {
        $record->publish();

        Notification::make()
            ->title('Post published')
            ->success()
            ->send();
    });
```

## Bulk Action Notification

```php
use Laravilt\Actions\BulkAction;
use Laravilt\Notifications\Notification;

BulkAction::make('publish')
    ->action(function ($records) {
        $records->each->publish();

        Notification::make()
            ->title("{$records->count()} posts published")
            ->success()
            ->send();
    });
```

## Next Steps

- [Confirmation](https://github.com/laravilt/laravilt/blob/HEAD/docs/actions/confirmation) - Confirmation modals
- [Authorization](https://github.com/laravilt/laravilt/blob/HEAD/docs/actions/authorization) - Permissions
- [Introduction](https://github.com/laravilt/laravilt/blob/HEAD/docs/actions/introduction) - Overview
