<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use View;
use Session;
use Illuminate\Support\Facades\Auth;

class RedirectIfNotUser{
    
    public function handle($request, Closure $next)
    {
        if(Auth::check() === false){
            return redirect(route('home'));
        }
        return $next($request);
    }
}
