Notifications

May 30, 2026 · View on GitHub

The navbar bell and messages dropdowns are wired to real Laravel data — and fall back to the config-driven demo arrays when the backing tables don't exist. So the navbar is 1:1 with the AdminLTE HTML demo out of the box, and becomes real the moment you scaffold notifications (and/or the mailbox).

How the navbar is fed

ColorlibHQ\AdminLte\Support\NavbarData powers both dropdowns:

DropdownReal source (when present)Fallback
Bell (notifications)auth()->user()->unreadNotifications (the notifications table)config('adminlte.navbar_notifications') demo array
Messagesunread rows in adminlte_messages addressed to the current user (the scaffolded mailbox)config('adminlte.navbar_messages') demo array

Table-existence is checked once per request (memoized) and wrapped defensively, so a missing table or a pre-migration request can never break rendering. The bell badge shows the live unread count; the footer link points at the notifications page when it exists.

If you published the navbar partials into your app (resources/views/vendor/adminlte/partials/navbar-notifications.blade.php), re-publish them (or re-apply the change) to pick up the real-data wiring — published views override the package's.

Scaffolding

php artisan adminlte:scaffold notifications --seed

Publishes:

ArtifactDestination
create_notifications_table migrationdatabase/migrations/
AdminLteDemoNotificationapp/Notifications/
NotificationControllerapp/Http/Controllers/AdminLte/
Index viewresources/views/adminlte/notifications/
AdminLteNotificationsSeederdatabase/seeders/
NotificationsTesttests/Feature/AdminLte/
Routesnotifications.* in the managed /admin group

Routes:

VerbURIName
GET/admin/notificationsadminlte.notifications.index
PUT/admin/notifications/read-alladminlte.notifications.read-all
PUT/admin/notifications/{id}/readadminlte.notifications.read
DELETE/admin/notifications/{id}adminlte.notifications.destroy

The index page lists all notifications with per-row mark-as-read / delete and a "mark all as read" action.

Sending notifications

AdminLteDemoNotification is a standard database notification — use it as a template:

use App\Notifications\AdminLteDemoNotification;

$user->notify(new AdminLteDemoNotification(
    title: 'Order shipped',
    message: 'Your order #1234 is on its way.',
    icon: 'bi bi-truck',
    url: route('orders.show', $order),
));

The data keys the navbar/index read are title, message, icon, and url. Any notification with the database channel that includes those keys renders correctly.

Adding a menu item

// config/adminlte.php
['text' => 'notifications', 'route' => 'adminlte.notifications.index', 'icon' => 'bi bi-bell'],