CheckProGuest.php 470 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. use Illuminate\Http\Request;
  5. class CheckProGuest
  6. {
  7. /**
  8. * Handle an incoming request.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @param \Closure $next
  12. * @return mixed
  13. */
  14. public function handle(Request $request, Closure $next)
  15. {
  16. if (session()->has('member.is_member')) {
  17. return redirect()->to('/');
  18. }
  19. return $next($request);
  20. }
  21. }