Inertia UI Notifications is a new package by Pascal Baljet for Laravel applications that use Inertia.js. It includes toast messages, a notification inbox, and notification preferences, with components for Vue and React. The package is free and open source under the MIT licence.
Flash Toasts from Laravel
The Toast class lets you send feedback from a controller after an action succeeds or fails:
use InertiaUI\Notifications\Toast; Toast::success('Profile saved') ->description('Your changes are live.') ->flash(); return back();
The frontend's Toaster component displays the message after the next Inertia response. Toasts use Inertia's flash data, which stays out of browser history, so navigating back does not show the message again. Flashing requires a session; calling flash() from a queued job does nothing.
You can add buttons that visit a URL, send a request, or dispatch a browser event. Toasts also support custom types, images, and progress bars. Giving a toast an ID lets you replace an existing message as an operation progresses.
Laravel's starter kits already include toast notifications. The package documents how to migrate those calls or keep the existing calls and change the frontend listener.
Show Toasts from Vue or React
For actions that happen in the browser, such as copying a link, use the frontend toast() API. It also handles promises and Inertia form submissions. For example, toast.track() supplies the callbacks for a form visit:
import { toast } from '@inertiaui/notifications-vue' form.post('/invoices', toast.track({ loading: 'Saving invoice...', error: 'Could not save the invoice', }))
Here, form is an existing Inertia useForm instance, and /invoices is the application's form endpoint. The loading toast closes when the visit succeeds, allowing a toast flashed by the server to appear. Validation errors replace the loading message with the error message. React uses the same API from @inertiaui/notifications-react.
Keep Notifications in an Inbox
The notification center stores messages for users to read later. It provides a bell with an unread count and a panel, plus a NotificationList component for a separate notifications page with infinite scroll.
To send a message, add the inbox channel to a Laravel notification and return an InboxMessage from its toInbox() method:
namespace App\Notifications; use App\Models\Invoice; use Illuminate\Notifications\Notification; use InertiaUI\Notifications\InboxMessage; use InertiaUI\Notifications\ToastType; class InvoicePaid extends Notification { public function __construct(public Invoice $invoice) {} public function via(object $notifiable): array { return ['inbox']; } public function toInbox(object $notifiable): InboxMessage { return InboxMessage::make('Invoice :number paid', [ 'number' => $this->invoice->number, ]) ->url(route('invoices.show', $this->invoice)) ->category('billing') ->toast(ToastType::Success); } }
This example assumes your application has an Invoice model and an invoices.show route. Send the notification with Laravel's usual $user->notify(new InvoicePaid($invoice)) call. It uses only the inbox channel and sends no email. The toast() method requests a toast during the recipient's own request, or when the notification arrives through the package's real-time integration. When the inbox panel is open, the message appears there instead of as a toast. Notification hours and pauses can also silence the toast.
The panel supports category filters, grouping, snoozing, and muting threads. Category buttons need the inbox.category_filter option configured. Grouping combines rows visually while keeping their separate records; collapse() updates one stored notification for messages with the same group key during a chosen time window. You can also update or retract sent messages.
Counts update on each Inertia visit by default. For real-time arrivals, configure Laravel broadcasting, enable inbox.broadcast_notifications, and pass Laravel Echo through initNotifications({ inbox: { echo } }). Broadcasts are queued, so a queue worker must process them unless the queue connection is sync. Alternatively, polling refreshes counts at a chosen interval, with the panel loading new messages when it opens.
Let Users Choose What They Receive
The NotificationPreferences component displays switches for the categories and delivery channels you configure. A user could receive comment notifications in the app while turning off comment emails. You can lock categories such as security alerts, or make product updates opt-in.
For categories with digests enabled, users can choose hourly, daily, or weekly email digests in their own timezone. Digests require the published migrations and scheduling inertia-notifications:send-digests every minute. Notifications need a toInbox() message and a delivery channel covered by digests, such as mail. Receiving an inbox notification alone does not send an email.
Notification hours and pausing are disabled by default. Once you enable them, users can silence alerts while messages continue to reach the inbox. Emails held by these settings wait for the digest command. Locked categories and notifications without a category listed in the preferences still send as usual.
The package includes web push support for supported browsers while the application's tabs are closed. Enable push, generate VAPID keys, run the published migrations, and call ->push() on messages sent through the inbox channel. Push delivery uses queued jobs. Users grant browser permission and subscribe each device through the preferences component. It requires HTTPS or localhost; on iOS, users must add the app to their Home Screen.
Installation
The package requires PHP 8.3+, Laravel 12 (12.14.1+) or 13, Inertia Laravel 3.8+, Inertia.js 3.11+, and Tailwind CSS 4.3+. On the frontend, it supports Vue 3.5+ or React 19.
Install the PHP package and publish its configuration and migrations:
composer require inertiaui/notifications php artisan inertia-notifications:install
Then install the frontend package for your stack. For Vue:
npm install vendor/inertiaui/notifications/vue
For React, use vendor/inertiaui/notifications/react. Both frontend packages are also available on npm; their versions should match the Composer package.
Import the theme and register the component sources in resources/css/app.css. For the Vue package installed from vendor:
@import 'tailwindcss'; @import '@inertiaui/notifications-vue/theme.css'; @source '../../vendor/inertiaui/notifications/vue/src/**/*.{ts,vue}';
Call initNotifications() before createInertiaApp() in your frontend entry point, then render a Toaster in a persistent layout.
To enable the inbox, run the published migrations, add InertiaUI\Notifications\Concerns\HasInbox alongside Notifiable on your user model, and register Route::inertiaNotifications() in routes/web.php. Render the NotificationCenter component where you want the bell. If your users have UUID or ULID keys, adjust the published polymorphic columns before running the migrations.
The documentation includes setup for both frontend stacks, custom markup, and testing helpers for toasts, inbox messages, and preferences. You can find the source on GitHub at inertiaui/notifications.