MCPcopy Create free account
hub / github.com/CoderOpen/waimai / RedirectIfAuthenticated

Class RedirectIfAuthenticated

app/Http/Middleware/RedirectIfAuthenticated.php:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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('/home');
22 }
23
24 return $next($request);
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected