router->bind('user', function ($value, $route) { /** @var \App\Models\Subuser $match */ $match = $route->parameter('server') ->subusers() ->whereRelation('user', 'uuid', '=', $value) ->firstOrFail(); return $match->user; }); return parent::handle($request, $next); } }