12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Http\Middleware;
- use Closure;
- use Illuminate\Support\Facades\Auth;
- class RedirectIfAuthenticated
- {
-
- public function handle($request, Closure $next, ...$guards)
- {
- foreach ($guards as $guard) {
- if (Auth::guard($guard)->check()) {
- return redirect('/');
- }
- }
- return $next($request);
- }
- }
|