📜  laravel 维护模式自定义类 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:36.325000             🧑  作者: Mango

代码示例1
app = $app;
    }

    public function handle(Request $request, Closure $next)
    {
        if ($this->app->isDownForMaintenance() && 
            !in_array($request->getClientIp(), ['8.8.8.8', '8.8.4.4']))
        {
            $maintenanceMode = new MaintenanceMode($this->app);
            return $maintenanceMode->handle($request, $next);
        }

        return $next($request);
    }

}