/** * Login user to the admin panel * * @param Request $request * @return mixed */ public function doLogin(Request $request) { $this->validate($request, ['username' => 'required', 'password' => 'required']); if (!$this->user->login($request->all())) { return redirect()->back()->withErrors(['global' => 'Invalid user or password!']); } return redirect()->route('admin.home'); }