eminiarts/aura-notifications
Aura Notifications is a Laravel package that adds a flexible notification system with database and broadcast channels, read/unread tracking, and customizable templates, helping you keep users informed without building notification plumbing from scratch.
composer require eminiarts/aura-notifications
database notification channel requires a notifications table. If your app doesn't already have one, generate it with php artisan notifications:table and migrate. Also check whether the package ships its own migrations/config (php artisan vendor:publish --provider="...AuraNotificationsServiceProvider" — confirm the exact provider name in the README).Notifiable trait to whichever model should receive notifications (usually App\Models\User) and make sure your auth guard resolves that model.// app/Notifications/WelcomeNotice.php
public function via($notifiable) { return ['database']; }
public function toArray($notifiable)
{
return [
'title' => 'Welcome aboard',
'message' => 'Your workspace is ready.',
];
}
Trigger it once ($user->notify(new WelcomeNotice)), then open the sidebar bell. If the badge shows 1, the plumbing works and you can ignore the rest of the integration surface until you need it.Where to look first: the README on GitHub is currently the only documentation referenced — read it end to end before writing code, particularly the notification payload shape, since the panel is presumably rendering your toArray()/toDatabase() keys directly.
Separate "user notifications" from "system updates". The release notes describe two distinct streams surfaced as tabs. Treat them as two notification classes (or two payload type values) rather than one generic notifier — otherwise every future feature announcement lands in the same inbox as password-change alerts and the "Updates" tab becomes noise.
// One class per concern, not one class with a $type switch
$user->notify(new SecurityPatchAvailable($patch)); // -> Updates tab
$user->notify(new InvoiceReady($invoice)); // -> All tab
Fan-out for system updates, queue for the rest. Announcements and maintenance notices go to every user, so wrap them in a queued notification with ShouldQueue and chunk the recipient list:
User::query()->chunkById(500, fn ($users) =>
Notification::send($users, new MaintenanceScheduled($window))
);
This keeps a release-day announcement from becoming a synchronous request that times out halfway through your user table.
Treat the bell and panel as UI you compose around, not logic you own. The package handles read/unread state and the slide-over; your job is emitting well-shaped payloads and (if needed) slotting the bell into Aura's sidebar via whatever extension point the README documents. Avoid querying the notifications table yourself for the badge count — duplicate sources of truth will drift from the package's unread logic.
Team scoping mirrors your tenancy model. If you use teams, make sure the team_id (or equivalent) you attach to update notifications matches the identifier the panel filters on. Centralise this in a base notification class or a Notification::send wrapper so a new notification type can't silently land in the wrong team's feed. Global updates should be an explicit choice (null team), not a default.
Pair with observers for domain events. The cleanest day-to-day pattern is triggering notifications from model observers or domain events (SubscriptionExpired, DeployCompleted) rather than sprinkling $user->notify(...) through controllers — you'll want the same notification fired from a scheduled command, a webhook, and an admin action eventually.
notifications + Blade. Evaluate whether you actually need the Aura integration before installing.composer.json and read the diff before upgrading.toArray() output, renaming title/message will produce blank UI rather than an error. Add a small test or a shared DTO/NotificationPayload value object so a typo fails in CI instead of silently rendering nothing.notifications.read_at column. If "mark all as read" appears to do nothing, query the table directly before blaming the UI — a mismatched notifiable_type/notifiable_id (common after renaming a model or switching guards) is the usual culprit.content paths (or that it ships precompiled CSS), otherwise the panel renders unstyled in production but fine in local dev — a classic and confusing symptom.notifications, temporarily dd() the component's query. Nine times out of ten it's a scoping mismatch (team filter or notifiable guard) rather than a rendering bug.How can I help you explore Laravel packages today?