'web' middleware must be applied to all routes where you need sessions, which Auth uses.
Check your login function, i had this problem and resolve with this in my AuthController:
public function Login(Request $request)
{
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
$throttles = $this->isUsingThrottlesLoginsTrait();
if ($throttles && $lockedOut = $this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
$credentials = ['nm_login' => $request->get('email'), 'password'=>$request->get('password')];
if (Auth::guard($this->getGuard())->attempt($credentials, $request->has('remember'))) {
return $this->handleUserWasAuthenticated($request, $throttles);
}
// If the login attempt was unsuccessful we will increment the number of attempts
// to login and redirect the user back to the login form. Of course, when this
// user surpasses their maximum number of attempts they will get locked out.
if ($throttles && ! $lockedOut) {
$this->incrementLoginAttempts($request);
}
return $this->sendFailedLoginResponse($request);
}
I'm use custom login.
Sorry for my english, but i hope you understand
There was something wrong with my barryvdh/laravel-ide-helper. I had to start over with a fresh laravel install and copy/paste my code. Everything is fine now.
Thanks anyway.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community