<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class Login
{
    /**
     *
     * @param $request
     * @param Closure $next
     * @return array|mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if (Auth::check()) {
            return $next($request);
        }else{
            return redirect('/');
        }
    }
}

