public function postLogin(LoginRequest $request) { $input = $request->except('_token'); $logged = Auth::attempt(['email' => $input['email'], 'password' => $input['password']]); if ($logged) { if (Auth::user()->type == 'admin') { return redirect()->route('dashboard'); } else { return redirect()->route('dashboard'); } } else { return redirect()->route('auth.login')->witherrors('Information not matched or something went wrong'); } }
public function postAuthLogin(LoginRequest $request) { $array = $request->all(); if (Auth::attempt(['email' => $array['email'], 'password' => $array['password']])) { return redirect()->intended('/profile/' . Auth::user()->username); } Session::flash('notify', ['type' => 'error', 'text' => 'El usuario y/o password es incorrecto']); return redirect()->route('login')->withInput($request->except('password')); }