From c788a80d0381cbb476eb0cbc46fb55aa78b5a24a Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:47:22 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Agora=20verifica=20se=20o=20usu=C3=A1ri?= =?UTF-8?q?o=20est=C3=A1=20logado=20antes=20de=20concluir=20uma=20a=C3=A7?= =?UTF-8?q?=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ClientService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/ClientService.php b/app/Services/ClientService.php index 4ed0af6..8368323 100644 --- a/app/Services/ClientService.php +++ b/app/Services/ClientService.php @@ -4,6 +4,7 @@ use App\Models\Client; use App\Models\User; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Gate; class ClientService @@ -12,6 +13,10 @@ class ClientService public function __construct(protected Client $client) {} public function addClient(array $client) { + if (!Auth::check()) { + return redirect()->to('/login'); + } + return Client::create($client); } }