lasthourcloud/app/Http/Livewire/Server/Show.php

29 lines
762 B
PHP
Raw Normal View History

2023-08-29 12:36:17 +00:00
<?php
namespace App\Http\Livewire\Server;
use App\Models\Server;
2023-08-29 13:51:30 +00:00
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
2023-08-29 12:36:17 +00:00
use Livewire\Component;
class Show extends Component
{
2023-08-29 13:51:30 +00:00
use AuthorizesRequests;
2023-08-29 12:36:17 +00:00
public ?Server $server = null;
public function mount()
{
2023-08-29 13:51:30 +00:00
try {
2023-09-14 15:45:00 +00:00
$this->server = Server::ownedByCurrentTeam(['name', 'description', 'ip', 'port', 'user', 'proxy'])->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
}
2023-08-29 13:51:30 +00:00
} catch (\Throwable $e) {
return general_error_handler(err: $e, that: $this);
}
2023-08-29 12:36:17 +00:00
}
public function render()
{
return view('livewire.server.show');
}
}