title: Laravel 5.1 SSL in Localhost
body: <p>I'm moving my working project to laravel. In order process i'm using SSL Certificate.</p>
  
  <p>cart, orderAddress, orderPayment, orderResults are four steps of Order Process.</p>
  
  <p>My first question is "What is best practice to disable ssl certificate in localhost ?"</p>
  
  <p>If mine is good (in below) "How can i shorten this code ?" Because i'm repeating myself that's why i didn't like.</p>
  
  <pre><code>/**
   * Disable ssl in Localhost
   */
  if (App::environment('local')) {
      Route::get('/cart', [
          'uses' =&gt; 'CartController@index',
          'as'   =&gt; 'cart',
      ]);
      Route::get('/orderAddress', [
          'uses' =&gt; 'AddressController@orderIndex',
          'as'   =&gt; 'orderAddress',
      ]);
      Route::get('/orderPayment', [
          'uses' =&gt; 'PaymentController@orderPayment',
          'as'   =&gt; 'orderPayment',
      ]);
      Route::get('/orderResult', [
          'uses' =&gt; 'OrderController@orderResult',
          'as'   =&gt; 'orderResult',
      ]);
  } else {
  /**
   * SSL PAGES
   */
  Route::group(['before' =&gt; 'force.ssl'], function()
  {
      Route::get('/cart', [
          'uses' =&gt; 'CartController@index',
          'as'   =&gt; 'cart',
      ]);
      Route::get('/orderAddress', [
          'uses' =&gt; 'AddressController@orderIndex',
          'as'   =&gt; 'orderAddress',
      ]);
      Route::get('/orderPayment', [
          'uses' =&gt; 'PaymentController@orderPayment',
          'as'   =&gt; 'orderPayment',
      ]);
      Route::get('/orderResult', [
          'uses' =&gt; 'OrderController@orderResult',
          'as'   =&gt; 'orderResult',
      ]);
  });
  
  Route::filter('force.ssl', function()
  {
      if( ! Request::secure())
      {
          return Redirect::secure(Request::path());
      }
  
  });
  </code></pre>