Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

oneme's avatar
Level 1

changing guards from default doesn't make session and won't redirect properly

I defined a new guard with a new provider but although the attempt returns 'true' it doesn't make the session properly so it doesn't redirect properly to '/home' it still redirect to '/login', also the login form disappear. It's returns model data properly:

if(Auth::guard('company')->attempt(['email' => Input::get('email'), 'password' => Input::get('password')])){

$company = Auth::guard('company)->user(); //the model shows it's data

} else {

$company = null;

}

return view('home'); // no session, no redirect

0 likes
0 replies

Please or to participate in this conversation.