Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Notifications Laravel Package

filament/notifications

Add sleek, real-time notifications to your Filament admin panel. Create toast alerts and in-app messages with customizable titles, bodies, actions, icons, colors, and durations. Send notifications from your Laravel app and keep users informed without leaving the dashboard.

View on GitHub
Deep Wiki
Context7

title: Broadcast notifications

Introduction

By default, Filament will send flash notifications via the Laravel session. However, you may wish that your notifications are "broadcast" to a user in real-time, instead. This could be used to send a temporary success notification from a queued job after it has finished processing.

We have a native integration with Laravel Echo. Make sure Echo is installed, as well as a server-side websockets integration like Pusher.

Sending broadcast notifications

There are several ways to send broadcast notifications, depending on which one suits you best.

You may use our fluent API:

use Filament\Notifications\Notification;

$recipient = auth()->user();

Notification::make()
    ->title('Saved successfully')
    ->broadcast($recipient);

Or, use the notify() method:

use Filament\Notifications\Notification;

$recipient = auth()->user();

$recipient->notify(
    Notification::make()
        ->title('Saved successfully')
        ->toBroadcast(),
)

Alternatively, use a traditional Laravel notification class by returning the notification from the toBroadcast() method:

use App\Models\User;
use Filament\Notifications\Notification;
use Illuminate\Notifications\Messages\BroadcastMessage;

public function toBroadcast(User $notifiable): BroadcastMessage
{
    return Notification::make()
        ->title('Saved successfully')
        ->getBroadcastMessage();
}

Setting up websockets in a panel

The Panel Builder comes with a level of inbuilt support for real-time broadcast and database notifications. However there are a number of areas you will need to install and configure to wire everything up and get it working.

  1. If you haven't already, read up on broadcasting in the Laravel documentation.
  2. Install and configure broadcasting to use a server-side websockets integration like Pusher.
  3. If you haven't already, you will need to publish the Filament package configuration:
php artisan vendor:publish --tag=filament-config
  1. Edit the configuration at config/filament.php and uncomment the broadcasting.echo section - ensuring the settings are correctly configured according to your broadcasting installation.
  2. Ensure the relevant VITE_* entries exist in your .env file.
  3. Clear relevant caches with php artisan route:clear and php artisan config:clear to ensure your new configuration takes effect.

Your panel should now be connecting to your broadcasting service. For example, if you log into the Pusher debug console you should see an incoming connection each time you load a page.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager