29 lines
762 B
PHP
Raw Normal View History

2023-08-29 14:36:17 +02:00
<?php
namespace App\Http\Livewire\Server;
use App\Models\Server;
2023-08-29 15:51:30 +02:00
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
2023-08-29 14:36:17 +02:00
use Livewire\Component;
class Show extends Component
{
2023-08-29 15:51:30 +02:00
use AuthorizesRequests;
2023-08-29 14:36:17 +02:00
public ?Server $server = null;
public function mount()
{
2023-08-29 15:51:30 +02:00
try {
2023-09-14 17:45:00 +02: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 15:51:30 +02:00
} catch (\Throwable $e) {
return general_error_handler(err: $e, that: $this);
}
2023-08-29 14:36:17 +02:00
}
public function render()
{
return view('livewire.server.show');
}
}