3 namespace App\Http\Controllers\Auth;
5 use App\Http\Controllers\Controller;
6 use App\Http\Requests\Auth\LoginRequest;
7 use App\Providers\RouteServiceProvider;
8 use Illuminate\Http\Request;
9 use Illuminate\Support\Facades\Auth;
11 class AuthenticatedSessionController extends Controller
14 * Display the login view.
16 * @return \Illuminate\View\View
18 public function create()
20 return view('auth.login');
24 * Handle an incoming authentication request.
26 * @param \App\Http\Requests\Auth\LoginRequest $request
27 * @return \Illuminate\Http\RedirectResponse
29 public function store(LoginRequest $request)
31 $request->authenticate();
33 $request->session()->regenerate();
35 return redirect()->intended(RouteServiceProvider::HOME);
39 * Destroy an authenticated session.
41 * @param \Illuminate\Http\Request $request
42 * @return \Illuminate\Http\RedirectResponse
44 public function destroy(Request $request)
46 Auth::guard('web')->logout();
48 $request->session()->invalidate();
50 $request->session()->regenerateToken();