/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @throws \Symfony\Component\HttpKernel\Exception\HttpException * @return mixed */ public function handle($request, Closure $next) { if ($this->application->isDownForMaintenance()) { $data = json_decode(file_get_contents($this->application->storagePath() . '/bootstraps/down'), true); throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']); } return $next($request); }