only('email', 'password'); $user = User::where('email', $credentials['email'])->first(); if (!$user || !Hash::check($credentials['password'], $user->password)) { return back()->withErrors([ 'email' => 'The provided credentials do not match our records.', ]); }else{ auth()->login($user); return redirect()->intended('admin/dashboard'); } } public function dashboard() { return view('admin.dashboard'); } }