Refactor Show component to use firstOrFail method when retrieving server by UUID
This commit is contained in:
parent
513c74a7e3
commit
9044c655b8
1 changed files with 1 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue