source: app/Http/Middleware/RedirectIfAuthenticated.php

Last change on this file was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago

initial commit

  • Property mode set to 100644
File size: 544 bytes
RevLine 
[0924b6c]1<?php
2
3namespace App\Http\Middleware;
4
5use Closure;
6use Illuminate\Support\Facades\Auth;
7
8class RedirectIfAuthenticated
9{
10 /**
11 * Handle an incoming request.
12 *
13 * @param \Illuminate\Http\Request $request
14 * @param \Closure $next
15 * @param string|null $guard
16 * @return mixed
17 */
18 public function handle($request, Closure $next, $guard = null)
19 {
20 if (auth()->guard($guard)->check()) {
21 return redirect()->route("dashboard.index");
22 }
23
24 return $next($request);
25 }
26}
Note: See TracBrowser for help on using the repository browser.