Refactor BaseComponent to remove unused code and initialize route parameters in the boot method

This commit is contained in:
Andras Bacsai committed 2024-10-17 22:00:27 +02:00
1 parent bfa9a8776e
commit 513c74a7e3
3 files changed
+14 -27

No files matched your search

+5 -2
View File
@@ -2,22 +2,25 @@
namespace App\Livewire\Server;
use App\Livewire\BaseComponent;
use App\Models\Server;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
class Show extends BaseComponent
class Show extends Component
{
use AuthorizesRequests;
public Server $server;
public array $parameters;
protected $listeners = ['refreshServerShow'];
public function mount()
{
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail();
$this->parameters = get_route_parameters();
} catch (\Throwable $e) {
return handleError($e, $this);
}