title: Laravel5 RouteServiceProvider not working
body: <p>could you help me with my problem? I'm working with laravel5 <code>App/Providers/RouteServiceProvider</code>. I'm trying to add to routes prefix in dependence on current lang. E.g.:
  I have routes.php, where are routes like:</p>
  
  <pre><code>/blog
  /home
  </code></pre>
  
  <p>And I need to do this:
  I url is for example:</p>
  
  <pre><code>/en/blog
  </code></pre>
  
  <p>I get the "lang" from url and I want to add routes prefix, to match it with my routes. So It will do smth. like this:</p>
  
  <pre><code>$router-&gt;group(['namespace' =&gt; $this-&gt;namespace, 'prefix' =&gt; $locale], function($router) {
              require app_path('Http/routes.php');
  });
  </code></pre>
  
  <p>I don't know why, but it doesn't work... if url is <code>/en/blog</code>, It didn't match with any route, anyway it should... 
  I also tried to change namespace and in some controller method do this:</p>
  
  <pre><code>die(print_r(Route::getCurrentRoute()));
  </code></pre>
  
  <p>but namespace for all routes was: <code>App\Controllers</code></p>
  
  <p>Do you have an idea, why it doesn't work?</p>
  
  <p>In my opinion, RouteServiceProvider isn't loaded, because also, when I try to put in method <code>map</code> or method <code>boot</code> <code>die('smth');</code> it didn't do anything... </p>
  
  <p>Here is my route service provider:</p>
  
  <pre><code>&lt;?php namespace App\Providers;
  
  use Illuminate\Routing\Router;
  use Illuminate\Http\Request;
  use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
  
  class RouteServiceProvider extends ServiceProvider {
  
      /**
       * This namespace is applied to the controller routes in your routes file.
       *
       * In addition, it is set as the URL generator's root namespace.
       *
       * @var string
       */
      protected $namespace = 'App\Http\Controllers';
  
      /**
       * Define your route model bindings, pattern filters, etc.
       *
       * @param  \Illuminate\Routing\Router  $router
       * @return void
       */
      public function boot(Router $router)
      {
          parent::boot($router);
  
          //
      }
  
      /**
       * Define the routes for the application.
       *
       * @return void
       */
      public function map(Router $router, Request $request)
      {
          $locale = $request-&gt;segment(1);
          $this-&gt;app-&gt;setLocale($locale);
  
          $router-&gt;group(['namespace' =&gt; $this-&gt;namespace, 'prefix' =&gt; $locale], function($router) {
              require app_path('Http/routes.php');
          });
      }
  
  }
  </code></pre>