diff --git a/src/Illuminate/Foundation/Console/DownCommand.php b/src/Illuminate/Foundation/Console/DownCommand.php index 4382ccc2e1d5..17f576ae9554 100644 --- a/src/Illuminate/Foundation/Console/DownCommand.php +++ b/src/Illuminate/Foundation/Console/DownCommand.php @@ -14,9 +14,10 @@ class DownCommand extends Command * * @var string */ - protected $signature = 'down {--message= : The message for the maintenance mode. } + protected $signature = 'down {--message= : The message for the maintenance mode.} {--retry= : The number of seconds after which the request may be retried.} - {--allow=* : IP or networks allowed to access the application while in maintenance mode.}'; + {--allow=* : IP or networks allowed to access the application while in maintenance mode.} + {--except=* : Request URIs that shall be accessible while in maintenance mode.}'; /** * The console command description. @@ -52,6 +53,7 @@ protected function getDownFilePayload() 'message' => $this->option('message'), 'retry' => $this->getRetryTime(), 'allowed' => $this->option('allow'), + 'except' => $this->option('except'), ]; } diff --git a/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php b/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php index ca1af7269a82..c57318892970 100644 --- a/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php +++ b/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php @@ -45,6 +45,10 @@ public function handle($request, Closure $next) return $next($request); } + if (isset($data['except']) && in_array($request->getRequestUri(), (array) $data['except'])) { + return $next($request); + } + throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']); }