> ## Content Index
> Fetch the complete content index at: https://filamentmastery.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to send Filament database notifications to a specific queue
- URL: https://filamentmastery.com/articles/how-to-send-filament-database-notifications-to-a-specific-queue/
- Published: 2025-09-02T11:00:00.000Z
- Updated: 2026-05-26T12:56:55.000Z
- Description: Learn how to control the queue for Filament database notifications in Laravel instead of using the default queue.
- Author: Yebor974
- Tags: Admin Panels, Filament V3, Filament V4, Filament V5, Tips

When working with `Filament\Notifications\Notification`, sending database notifications with `sendToDatabase()` is super convenient. But what if you want to control which queue these notifications are dispatched to?

At first glance, this looks tricky, Filament doesn’t expose a queue configuration option directly. But the good news is: you can still take full advantage of Laravel’s queue system.

## Default behavior for Filament notifications on database

The usual Filament way looks like this:

```php
use Filament\Notifications\Notification;

Notification::make()
    ->title("Your request has been processed")
    ->body("Some details about the request")
    ->sendToDatabase($user);

```

What happens under the hood:

- Filament calls `$user->notify($this->toDatabase())`.
- `toDatabase()` creates a `Filament\Notifications\DatabaseNotification`, which extends Laravel’s `Notification`, implements `ShouldQueue`, and uses the `Queueable` trait.
- That means the notification goes into the queue defined by your `QUEUE_CONNECTION` (`database`, `redis`, etc.), but you **cannot specify which queue name** this way.

## How to control the queue: Using `toDatabase()` \+ `onQueue()`

Instead of `sendToDatabase()`, grab the notification instance with `toDatabase()` and apply `onQueue()`:

```php
use Filament\Notifications\Notification as FilamentNotification;

$databaseNotification = FilamentNotification::make()
    ->title("Your request has been processed")
    ->body("Some details about the request")
    ->toDatabase()              // returns a DatabaseNotification (Laravel Notification)
    ->onQueue('notifications'); // from Queueable trait

$user->notify($databaseNotification);

```

Or, in a single line:

```php
$user->notify(
    FilamentNotification::make()
        ->title("Your request has been processed")
        ->body("Some details about the request")
        ->toDatabase()
        ->onQueue('notifications')
);

```

This way you keep the simplicity of Filament’s fluent API **and** you get fine-grained queue control.

## Multiple users example

If you need to notify multiple users on the same queue:

```php
$notif = FilamentNotification::make()
    ->title("Your request has been processed")
    ->body("Some details about the request")
    ->toDatabase()
    ->onQueue('notifications');

foreach ($users as $user) {
    $user->notify($notif); // reuses the same notification instance
}

```

## Conclusion

If you just want to send database notifications, Filament’s `sendToDatabase()` is perfect.

But if you need **queue control**, switch to `toDatabase()->onQueue('...')`. That way you stay fully in the Filament ecosystem, so your notifications are correctly stored and displayed in your Filament panels, while still taking advantage of Laravel’s queue flexibility.

🙏 Thanks to [@obaume](https://github.com/obaume?ref=filamentmastery.com) for reaching out on this topic. His question made me dive deeper into Filament notifications and discover this approach!

💡 Community Idea: Currently, `sendToDatabase()` doesn’t allow specifying a queue. If this article gets enough likes or shares, I’ll consider proposing a Pull Request to Filament to add this feature—making queue management even easier for everyone!

💡

****Found this useful?**   
You can support Filament Mastery with [a tip](https://filamentmastery.com/#/portal/support)  
or unlock [all premium content](https://filamentmastery.com/membership/)