<?php

namespace App\Http\Middleware;

use Closure;

class AgentsAuth
{
    /**
     * 判断是否登陆.
     */
    public function handle($request, Closure $next)
    {
        $current_url = url()->current();
        
        if(empty(session('agent_auth'))) {
        	\Log::info('agent_auth');
        	return redirect()->to('/login');
        }else{
        	\Log::info('agent_auth');
        }

        $response = $next($request);
        return $response;
    }
}
