Missing required parameters but i'm passing them with a middleware

Posted 4 months ago by bufferoverflow

The routes file defines the routes for my users subdomain, so I need to pass the {subdomain} variable to every route. I made a simple middleware to achieve this:

    public function handle($request, Closure $next)
    {
        URL::defaults([
            'subdomain' => $request->subdomain
        ]);

        return $next($request);
    }

The problem is that when i add the Auth routes to the file, the missing parameter error appears:

Auth::routes(['verify' => true]); // Error missing parameter for route 'login'

If i print the php artisan route:list, the middleware is also applied to the auth routes. Why is it still complaining?

Please sign in or create an account to participate in this conversation.