diff --git a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php index 34e41d89b..f17439e28 100644 --- a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php +++ b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php @@ -17,9 +17,6 @@ class SubstituteClientBindings extends SubstituteBindings public function handle($request, Closure $next): mixed { // Override default behavior of the model binding to use a specific table column rather than the default 'id'. - $this->router->bind('server', function ($value) { - return $this->server->query()->where(strlen($value) === 8 ? 'uuidShort' : 'uuid', $value)->firstOrFail(); - }); $this->router->bind('user', function ($value, $route) { /** @var \App\Models\Subuser $match */ diff --git a/routes/api-client.php b/routes/api-client.php index af20e9bd4..1cf518632 100644 --- a/routes/api-client.php +++ b/routes/api-client.php @@ -51,7 +51,7 @@ Route::prefix('/account')->middleware(AccountSubject::class)->group(function () | Endpoint: /api/client/servers/{server} | */ -Route::prefix('/servers/{server}')->middleware(ServerSubject::class, AuthenticateServerAccess::class, ResourceBelongsToServer::class)->group(function () { +Route::prefix('/servers/{server:uuid}')->middleware([ServerSubject::class, AuthenticateServerAccess::class, ResourceBelongsToServer::class])->group(function () { Route::get('/', [Client\Servers\ServerController::class, 'index'])->name('api:client:server.view'); Route::get('/websocket', Client\Servers\WebsocketController::class)->name('api:client:server.ws'); Route::get('/resources', Client\Servers\ResourceUtilizationController::class)->name('api:client:server.resources');