public function handleLogin() { $credentials = Input::only('username', 'password'); $remember = Input::has('remember'); if (Auth::attempt($credentials, $remember)) { if (AppHelper::getAdminRole() == "Administrator") { return Redirect::intended('/admin')->with('flash_notice', 'Wow!You are successfully logged in.'); } elseif (AppHelper::getAdminRole() == "Accountant") { return Redirect::intended('/ac')->with('flash_notice', 'Wow!You are successfully logged in.'); } elseif (AppHelper::getAdminRole() == "Librarian") { return Redirect::intended('/library')->with('flash_notice', 'Wow!You are successfully logged in.'); } } return Redirect::to('login')->with('flash_error', 'Your username/password combination was incorrect.Please Try again')->withInput(); }