I'm trying to login an Admin and a User with the same form, but the config/auth I just only can to set a one default
This is my config/auth
'defaults' => [ 'guard' => 'web_users', 'passwords' => 'users', ], 'guards' => [ 'web_users' => [ 'driver' => 'session', 'provider' => 'users', ], 'web_admins' => [ 'driver' => 'session', 'provider' => 'admins', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ], ], 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ], 'admins' => [ 'driver' => 'eloquent', 'model' => App\Admin::class, ], ], When I log in a User with the default "web_users" I can retrieve his data with the method Auth::user(), but if I log in a Admin with the default "web_admins" can't retrieve anything.
Routes:
Route::resource('log','LogController'); Route::get('logout','LogController@logout'); Log Controller
public function store(Request $request) { if(Auth::guard('web_users')->attempt(['email'=>$request['email'],'password'=>$request['password']])) { return Redirect::to('/'); } if(Auth::guard('web_admins')->attempt(['email'=>$request['email'],'password'=>$request['password']])) { return Redirect::to('/'); } } public function logout() { Auth::logout(); return Redirect::to('log'); } Note: sorry for my english, I don't speak it very well