title: `php artisan down` throws uncaught 503 and yields an error page
body: <p><em>Edit:</em> Accepted Issue on GitHub <a href="https://github.com/octobercms/october/issues/2830" rel="nofollow noreferrer">https://github.com/octobercms/october/issues/2830</a></p>
  
  <hr>
  
  <p>I am using OctoberCMS which is based upon the Laravel PHP framework.<br>
  (I am a newbie to both). </p>
  
  <p>Ultimately, I'm trying to script as much of the site update process as possible. That is, <em>update/upgrade the testing and live sites and upload my new code</em>. This entails being able to put the site into maintenance mode from the command line. </p>
  
  <p>The top level directory for my website (<code>/var/www/website/</code>) contains the artisan php script. </p>
  
  <p>Running <code>php artisan list</code> I get:  </p>
  
  <pre><code>Available commands: 
      down    Put the application into maintenance mode 
      up      Bring the application out of maintenance mode 
  </code></pre>
  
  <p>Within the OctoberCMS backend I can put the frontend into maintenance mode, and the chosen maintenance page is shown as expected. </p>
  
  <p>When I enter <code>php artisan down</code> in the console I get <code>Application is now in maintenance mode.</code>, as expected. But when I reload the website, I get the following error:  </p>
  
  <blockquote>
    <p>We're sorry, but an unhandled error occurred. Please see the details below.<br>
    <code>.../vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php line 41</code><br>
       Type: Undefined<br>
       Exception: <code>Symfony\Component\HttpKernel\Exception\HttpException</code></p>
  </blockquote>
  
  <pre><code>\* 
  \* @throws \Symfony\Component\HttpKernel\Exception\HttpException 
  */ 
  public function handle($request, Closure $next) 
      { 
          if ($this-&gt;app-&gt;isDownForMaintenance()) { 
              throw new HttpException(503); 
          } 
      return $next($request); 
      } 
  </code></pre>
  
  <p>It would appear that Laravel/Symfony is doing what it should and throwing a <code>503 Service Unavailable</code>, but there is nothing to catch it and render the maintenance page. </p>
  
  <p>So, two questions<br>
  1) Is this a bug? If so, in Laravel or October? Or have I done something wrong -- config setting...?<br>
  2) Assuming it won't be 'fixed' any time soon, how and where should I catch the <code>HttpException(503)</code> and yield the maintenance page? </p>
  
  <p>There is what might be an answer in <code>Stackoverflow &gt; '503 can't be overridden in L5.1'</code>, which appears to suggest editing/overriding <code>public function handle($request, Closure $next)</code> with a <code>try/catch/return-if-503</code> sequence. But is it a good idea to override a function of the CMS/framework? If so, how and where? </p>
  
  <p>I have read <a href="https://octobercms.com/docs/services/error-log" rel="nofollow noreferrer">OctoberCMS > docs > services > Errors &amp; Logging</a> and, despite hoping for an easier solution, I would create a Plugin to solve the problem if that is the best/only/ideal way. Although creating a Plugin to catch what should surely already be caught seems overkill. </p>
  
  <p>This looks to be the way to do it <a href="https://stackoverflow.com/questions/26805599/laravel-pass-arguments-to-php-artisan-down">Laravel - Pass arguments to php artisan down</a>, but I'm not confident to attempt it.  </p>
  
  <hr>
  
  <p>Turnkey LAMP 14.1 server </p>
  
  <p>October system build 414 </p>
  
  <p><code>php --version</code><br>
  <code>PHP 5.6.30-0+deb8u1 (cli) (built: Feb  8 2017 08:50:21)</code>  </p>
  
  <p><code>php artisan --version</code><br>
  <code>Laravel Framework version 5.1.46 (LTS)</code>  </p>