Introduction
Inertia Notifications adds toasts, a notification center, and notification preferences to Laravel applications that use Inertia.js. You may use it with Vue 3 or React 19. It's part of Inertia UI, a suite of packages for Laravel, Inertia.js, and Tailwind CSS.
- Toasts flashed from Laravel with the
Toastclass, which use Inertia flash data, so they never show again when the user navigates back - Toasts from Vue or React with
toast(), including promises and Inertia visits - Actions that visit a URL, send a request, dispatch a browser event, or run a callback
- Descriptions, durations, progress bars, images, icons, positions, and IDs that replace an open toast
- Toasts from JSON endpoints, error toasts for failed requests, and a guide to moving the toasts of the Laravel starter kits
- Custom toast types, and toasts that stay usable above modal dialogs
- A notification center with a bell, an unread count, and a panel, fed by Laravel notifications through the
inboxchannel - Tabs, category filters, grouping, snoozing, muting, deleting, selecting, and keyboard shortcuts in the panel
- A notifications page with Inertia infinite scroll
- Real-time updates with Laravel Echo, or polling
- Announcements to every user, including users who sign up later
- Collapsing the notifications about one thing, and updating or retracting sent notifications
- Desktop notifications, a sound, and unread counts in the tab title and on the app icon
- Web push to phones and closed browsers, without extra packages, with commands that set it up and check it
- Notifications for each team or tenant
- Notification preferences for each category and channel, saved as users change them
- Hourly, daily, or weekly digest emails in the timezone of each user
- Notification hours for each day of the week, and pausing notifications until a time the user chooses
- Translations, Tailwind CSS v4 theme tokens, dark mode, custom markup, and keyboard and screen reader support
- Pest and PHPUnit helpers for testing toasts, the notification center, and preferences
- A Laravel Boost skill for AI coding agents
- The same features in Vue and React
Quick Example
You may flash a toast from any controller. The Toaster component shows it after the next Inertia response:
use App\Http\Requests\UpdateProfileRequest;
use InertiaUI\Notifications\Toast;
class ProfileController extends Controller
{
public function update(UpdateProfileRequest $request)
{
$request->user()->update($request->validated());
Toast::success('Profile saved')
->description('Your changes are live.')
->flash();
return back();
}
}The notification center keeps Laravel notifications for users to read later. Its NotificationCenter component shows them in a panel under a bell that counts new notifications. A notification whose via method returns the inbox channel appears in the panel once you send it:
$invoice = Invoice::find(1);
$invoice->user->notify(new InvoicePaid($invoice));Getting Started
The package has three parts:
- The
inertiaui/notificationsComposer package, with theToastclass and theinboxnotification channel. - The
@inertiaui/notifications-vuepackage for Vue 3. - The
@inertiaui/notifications-reactpackage for React 19.
Continue with the requirements and the installation.
Free and Open Source
Inertia Notifications is free and open source under the MIT license, so you may use it in personal and commercial projects. Its source code is on GitHub, where you may report issues and send pull requests. To support its development, you may sponsor it on GitHub.
Other Inertia UI Packages
Inertia UI is built and maintained by Pascal Baljet. Its other packages work with the same stack:
- Inertia Forms defines forms in PHP and renders them with one Vue or React component, with validation, file uploads, conditional fields, and multi-step flows. It's a commercial package.
- Inertia Table turns one PHP class into a data table with sorting, filtering, exports, saved views, and bulk actions, also across relationships. It's a commercial package.
- Inertia Modal turns any Laravel route into a modal or slideover with one component, including nested modals. It's free and open source.
Every Inertia UI package builds on Inertia UI Vanilla, our own lightweight library for dialogs, focus management, keyboard navigation, and positioning. The Vue and React packages have no dependencies on UI libraries such as Headless UI, Radix, Reka UI, or Floating UI, so both behave the same way, and a fix in Vanilla reaches every package at once. The PHP packages require nothing besides Laravel, Inertia, and other Inertia UI packages, and integrations such as Laravel Excel and Spatie Media Library stay optional.