๐ก Connection Flow
Browser (Vue + Echo)
โ WSS :443
NGINX (SSL + WS Upgrade)
โ Proxy
Laravel Reverb
โ
Authorized Channels
โ
Vue UI (Toast / Status)
๐งช Example Usage
This example demonstrates the ToastNotification feature. Once the job completes, a toast notification is triggered and broadcast to targeted users, companies, or pages.
$data = [ 'message' => 'Your Message', 'title' => 'Your Title' // Not used since the title was removed in FE, 'type' => $exception ? 'error' : 'info', // Targeting 'user_ids' => [$this->user->id], 'company_ids' => [] // This line can be removed, or the array can be emptied, 'pages' => [] // This line can be removed, or the array can be emptied, ]; // Safety wrap prevents exception from killing job try { event( new ToastNotification($data) ); } catch (\Throwable $e) { Log::warning( "Broadcast ToastNotification failed: " . $e->getMessage() ); }
โข All empty โ GLOBAL broadcast
โข Add one โ Scoped
โข Add more โ Hyper-targeted