Support the ongoing development of Laravel.io →
Authentication

Hello! I'm still learning how to use laravel. I am trying to introduce this authentication system jeremykenedy and I came across an error Declaration of App\Http\Middleware\Authenticate::handle($request, Closure $next) must be compatible with Illuminate\Auth\Middleware\Authenticate::handle($request, Closure $next, ...$guards)

If I delete everything from Authenticate.php and leave what was at the beginning (the basic one) everything is going perfectly, I just can't get into the "profiles" This shows me in the browser error:

public function handle($request, Closure $next) {
if (! $this->auth->check()) {

        return redirect()->to('/login')

            ->with('status', 'success')

            ->with('message', 'Please login.');
    }
    return $next($request);

}
Last updated 3 years ago.
0

I also have the same problem. Did you manage to find the solution?

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Alexander alexandern Joined 31 Mar 2021

Moderators

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

Your logo here?

Laravel.io

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

© 2025 Laravel.io - All rights reserved.