From 9044c655b884b25f843a44bf4cf4cfe53066eb42 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 17 Oct 2024 22:06:48 +0200 Subject: [PATCH] Refactor Show component to use firstOrFail method when retrieving server by UUID --- app/Livewire/Server/Proxy/Show.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Livewire/Server/Proxy/Show.php b/app/Livewire/Server/Proxy/Show.php index d70e44e55..5ecb56a69 100644 --- a/app/Livewire/Server/Proxy/Show.php +++ b/app/Livewire/Server/Proxy/Show.php @@ -22,10 +22,7 @@ public function mount() { $this->parameters = get_route_parameters(); try { - $this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first(); - if (is_null($this->server)) { - return redirect()->route('server.index'); - } + $this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(); } catch (\Throwable $e) { return handleError($e, $this); }