Skip to content

Backend Differences ​

Laravel PHP and Laravel Rust both support redirect and JSON toasts, inbox notifications, read state, announcements and preferences. The Vue and React components use the same data and endpoints. The table shows how each backend handles storage, delivery and background work.

AreaLaravel PHPLaravel Rust
Installation and storageComposer discovers the provider. Publish and run Laravel migrations. The package tests SQLite, MySQL and PostgreSQL.Register Notifications::sqlite() to use the application’s default SQLite connection. It creates its own tables at boot. Applications using MySQL or PostgreSQL for other data can supply a dedicated SQLite pool for notifications.
Recipients and routesAdd HasInbox and register Route::inertiaNotifications() with the desired middleware. The provider shares the inbox prop.Implement Receives<Inbox> on the authenticated model. The provider registers session-authenticated endpoints. The notifications middleware shares the inbox automatically.
Sending and retryingReturn inbox from via and build a message in toInbox. An Artisan command scaffolds the notification.Use #[via(Inbox)] and return an InboxDelivery. The delivery generates a UUID before queueing. Supply your own with with_id when dispatching the same event separately. There is no package notification generator.
Preferences across channelsPackage listeners on NotificationSending enforce preferences, pauses, notification hours, and digest decisions for configured channels.The inbox channel applies its own rules. For mail and other external channels, call delivery_decision before sending and honor its result. The package has no global listener for those channels.
Read delaysThe notification trait integrates with Laravel's queue to delay selected channels.Set the delay on the message and schedule the external channel in your worker. Check the decision with the original delivery UUID when the job runs.
Digest deliverySchedule the package’s Artisan command. It sends a Laravel notification and includes a Blade mail template.Schedule center.digests.send_due and supply the mail or channel transport. The renderer produces HTML and plain text. The runnable worker example writes to a SQLite outbox.
Web PushArtisan commands manage VAPID keys and diagnostics. Laravel jobs send pushes and auth listeners clean up devices.Configure a push service and a stable cookie key. Use the standalone inertia-notifications-push CLI to generate keys, diagnose, test or drain deliveries. Login and logout handlers call PushDevice::after_login or after_logout to update the browser’s device cookie.
Snoozes and retentionSchedule inertia-notifications:unsnooze and Laravel’s model:prune.The provider registers inertia-notifications:unsnooze. Schedule center.inbox.prune separately with a retention cutoff.
Teams and announcementsTeam context can use an Eloquent model and routes can use team parameters.Supply trusted context and audience keys on the recipient. The Laravel provider has a static prefix. The lower-level router can mount at a team-specific path.
TranslationToast text uses the Laravel translator; inbox messages can be translated when read.Supply a toast translator and a recipient translator when you use a catalog. Queued routes retain the locale; the application must restore any translation callback needed in the worker.
Backend testsUse the package's Pest and PHPUnit assertions and Laravel fakes.Use Laravel HTTP feature tests for handlers, the toast recorder for payloads, and an isolated SQLite store or injected transport for delivery tests.

The PHP demo in demo-app/ and the Rust demo in rust/examples/laravel/ show how the backend and frontend fit together. Follow the installation guide to add notifications to your own app.