router->bind('server', function ($value) { return Server::query()->where(strlen($value) === 8 ? 'uuidShort' : 'uuid', $value)->firstOrFail(); }); $this->router->bind('user', function ($value, $route) { /** @var \Pterodactyl\Models\Subuser $match */ $match = $route->parameter('server') ->subusers() ->whereRelation('user', 'uuid', '=', $value) ->firstOrFail(); return $match->user; }); return parent::handle($request, $next); } }