This is no longer needed

This commit is contained in:
Lance Pioch 2024-03-20 03:02:35 -04:00
parent cd9044753f
commit 3d740907db
2 changed files with 1 additions and 4 deletions

View File

@ -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 */

View File

@ -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');