Support the ongoing development of Laravel.io →
2 weeks ago
Last updated by @tjmahaffey 1 week ago.
0

Try to follow the syntax given in the official laravel documentation for the handle method

public function handle($request, Closure $next)
    {
        if ($request->input('age') < 200)
        {
            return redirect('home');
        }
 
        return $next($request);
    }

Use only $request variable without type hinting as shown in the example above and see if everything works.

0
Solution selected by @tjmahaffey

AH!! That was it, @faisal ! I totally overlooked that inconsistency and never would have guessed that simple type hinting would break that request object.

Thank you!

0

Happy to help people in resolving their issues.

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.