middleware('guest')->only('store'); } public function create() { return view('sessions.create'); } public function destroy() { auth()->logout(); return redirect()->home(); } public function store() { // Attempt to authenticate the user. // On failure, redirect back. if (!auth()->attempt(request(['email', 'password']))) { return back()->withErrors([ 'message' => 'Please check your credentials and try again', ]); }; // On success, sign them in. // Then redirect to home. return redirect()->home(); } }