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.
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!
Sign in to participate in this thread!