feat: Phase 2 - Laravel Reverb + real-time notifications
- Install laravel/reverb + laravel-echo + pusher-js - Configure broadcasting to reverb in .env.example + .env - Add Echo + Pusher client in resources/js/app.js - Update all 14 notifications to implement ShouldBroadcast + broadcastOn() - Update NotificationBell component to listen for real-time events - Add Livewire.emit in notification-bell blade for JS-to-Livewire bridge Tests: 101 passing (319 assertions)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Livewire\Common;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
|
||||
class NotificationBell extends Component
|
||||
@@ -37,6 +38,13 @@ class NotificationBell extends Component
|
||||
$this->loadNotifications();
|
||||
}
|
||||
|
||||
#[On('notification-received')]
|
||||
public function handleNotification($message = 'Nueva notificación')
|
||||
{
|
||||
$this->loadNotifications();
|
||||
$this->dispatch('notify', $message);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.common.notification-bell');
|
||||
|
||||
Reference in New Issue
Block a user