From 022924e20f057c25627e8a93e8a1e85bed71c5bb Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Thu, 19 Jan 2023 19:02:17 +0100 Subject: [PATCH] auth check --- app/Http/Livewire/LaravelEcho.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/Http/Livewire/LaravelEcho.php b/app/Http/Livewire/LaravelEcho.php index d71ddfba..50acbbf2 100644 --- a/app/Http/Livewire/LaravelEcho.php +++ b/app/Http/Livewire/LaravelEcho.php @@ -13,16 +13,18 @@ class LaravelEcho extends Component public function plebLoggedIn($data) { - $this->notification() - ->confirm([ - 'img' => $data['img'], - 'title' => 'Pleb alert!', - 'description' => $data['name'].' logged in', - 'icon' => 'bell', - 'acceptLabel' => '', - 'rejectLabel' => '', - 'iconColor' => 'primary', - 'timeout' => 60000, - ]); + if (auth()->check()) { + $this->notification() + ->confirm([ + 'img' => $data['img'], + 'title' => 'Pleb alert!', + 'description' => $data['name'].' logged in', + 'icon' => 'bell', + 'acceptLabel' => '', + 'rejectLabel' => '', + 'iconColor' => 'primary', + 'timeout' => 60000, + ]); + } } }