<?php

namespace App\Http\Middleware;

use Closure;

class ManageAuth
{
    /**
     * 判断是否登陆.
     */
    public function handle($request, Closure $next)
    {
        $current_url = url()->current();
//         var_dump('$current_url');var_dump($current_url);die();

        //判断如果是登陆、注册
//         if(strpos($current_url,'login') || strpos($current_url,'register'))
//         {
//              if(session('manage_auth')) return redirect()->to('/');
//         }else{
//              if(!session('manage_auth')) return redirect()->to('/');
//         }

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