coolify/app/Livewire/Server/Destination/Show.php

32 lines
706 B
PHP
Raw Normal View History

2023-10-09 11:00:18 +02:00
<?php
2023-12-07 19:06:32 +01:00
namespace App\Livewire\Server\Destination;
2023-10-09 11:00:18 +02:00
use App\Models\Server;
use Livewire\Component;
class Show extends Component
{
public ?Server $server = null;
2024-06-10 22:43:34 +02:00
2023-10-09 11:00:18 +02:00
public $parameters = [];
2024-06-10 22:43:34 +02:00
2023-10-09 11:00:18 +02:00
public function mount()
{
$this->parameters = get_route_parameters();
try {
2023-12-07 22:56:55 +01:00
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
2023-10-09 11:00:18 +02:00
if (is_null($this->server)) {
2024-01-07 16:23:41 +01:00
return redirect()->route('server.index');
2023-10-09 11:00:18 +02:00
}
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
2024-06-10 22:43:34 +02:00
2023-10-09 11:00:18 +02:00
public function render()
{
return view('livewire.server.destination.show');
}
}