source: app/Http/Middleware/RedirectIfAuthenticated.php@ 0924b6c

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

initial commit

  • Property mode set to 100644
File size: 544 bytes
Line 
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.