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

36 lines
869 B
PHP
Raw Permalink Normal View History

2023-10-09 09:00:18 +00:00
<?php
2023-12-07 18:06:32 +00:00
namespace App\Livewire\Server\PrivateKey;
2023-10-09 09:00:18 +00:00
use App\Models\PrivateKey;
use App\Models\Server;
use Livewire\Component;
class Show extends Component
{
public ?Server $server = null;
2024-06-10 20:43:34 +00:00
2023-10-09 09:00:18 +00:00
public $privateKeys = [];
2024-06-10 20:43:34 +00:00
2023-10-09 09:00:18 +00:00
public $parameters = [];
2024-06-10 20:43:34 +00:00
2023-10-09 09:00:18 +00:00
public function mount()
{
$this->parameters = get_route_parameters();
try {
2023-10-09 13:08:28 +00:00
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
2023-10-09 09:00:18 +00:00
if (is_null($this->server)) {
2024-01-07 15:23:41 +00:00
return redirect()->route('server.index');
2023-10-09 09:00:18 +00:00
}
$this->privateKeys = PrivateKey::ownedByCurrentTeam()->get()->where('is_git_related', false);
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
2024-06-10 20:43:34 +00:00
2023-10-09 09:00:18 +00:00
public function render()
{
return view('livewire.server.private-key.show');
}
}