yassir3wad/nova-realtime-notification
yassir3wad/nova-realtime-notification brings real-time notifications to Laravel Nova, delivering instant in-app alerts through Laravel broadcasting so admins receive live updates without refreshing. It offers a simple way to add timely, event-driven feedback to Nova dashboards and workflows.
composer require yassir3wad/nova-realtime-notification, then publish the package assets/config (php artisan vendor:publish --provider="Yassir3wad\NovaRealtimeNotification\..." — confirm the exact provider/tag in the README, as it may ship a JS asset and a config file).BROADCAST_CONNECTION (Laravel 11+) or BROADCAST_DRIVER (Laravel 10 and below) to pusher, reverb, or ably, fill the matching credentials in config/broadcasting.php / .env, and verify window.Echo connects from the Nova UI.$user->notify(new SomeNovaNotification(...))), keep the Nova window open, and confirm the bell/list updates without a page reload.Notification classes with toNova()/toDatabase(); the package listens on the broadcast side and refreshes Nova's notification list. You don't change how you author notifications, only how they're delivered (must implement ShouldBroadcast or use a broadcasting channel).ShouldBroadcast rather than ShouldBroadcastNow) in production so the HTTP request isn't blocked by the broadcast handshake; run php artisan queue:work alongside your web server.App.Models.User.{id} or the package's configured equivalent) consistent between your broadcast broadcastOn() and routes/channels.php authorization callback. If you use a custom guard or a non-App\Models\User model, update the channel authorization and the package config together.setInterval refresh (or refresh-on-focus) covers dropped websockets.php artisan queue:work + npm run dev (or php artisan reverb:start) + browser devtools "WS" tab open. Use BROADCAST_CONNECTION=log temporarily to confirm the event is dispatched before debugging the client.Event::fake() / Notification::fake() and assertPushed-style assertions; the browser refresh itself is untestable in PHPUnit, so keep the assertion at the dispatch boundary.1.0.1 and worked around the missing refresh with your own JS listener, polling interval, or Nova.$emit handler, remove it — otherwise you'll double-fetch the notifications endpoint on every broadcast. Bump to ^1.0.2 and delete the workaround in the same PR.BROADCAST_DRIVER was renamed to BROADCAST_CONNECTION in Laravel 11. Copying an old .env example will silently leave broadcasting on null and nothing will arrive.window.Echo is initialized (via resources/js/bootstrap.js in your app or a Nova asset) and that the package's listener isn't registering before Echo exists. A "listener registered but never fires" bug usually means Echo was undefined at registration time./broadcasting/auth, not as JS errors — check the network tab before assuming the package is broken. Session/CSRF and the Broadcast::channel() callback are the usual culprits.ShouldBroadcastNow in tests: Notification::fake() prevents broadcasting entirely, so a "realtime doesn't work in tests" report is expected behavior, not a regression.vendor/. Overriding the JS asset means you own re-applying changes on every composer update, so prefer config where possible.log) → (2) does the websocket connection establish? → (3) does /broadcasting/auth return 200? → (4) does the list refresh but stay empty? (persistence/authorization) → (5) does it refresh twice? (leftover workaround).How can I help you explore Laravel packages today?