title: Angular routing with Laravel
body: <p>I have a Laravel route that serves an angular app. I want it running under the <code>/live</code> folder, so:</p>
  
  <pre><code>Route::group(array('prefix' =&gt; 'live', 'before' =&gt; 'auth'), function()
  {
      Route::any('', [ 'as' =&gt; 'live.index', 'uses' =&gt; 'LiveController@index' ]);
      Route::any('{all}', [ 'as' =&gt; 'live.index', 'uses' =&gt; 'LiveController@index' ])-&gt;where('all', '.*');
  });
  </code></pre>
  
  <p>The <code>LiveController</code> just makes and returns the view. This means that anything with the base-url <code>/live</code> will load the angular app.</p>
  
  <p>I've set the <code>&lt;base href="/app/" /&gt;</code> because my app is living under <code>public/app</code>, and this seems to work. However, on visiting <code>/live</code>, Angular converts the url to:</p>
  
  <pre><code>`live#/`
  </code></pre>
  
  <p>rather than:</p>
  
  <pre><code>`live/#/`
  </code></pre>
  
  <p>Here's my Angular routing file:</p>
  
  <pre><code>(function(){
  
      'use strict';
  
      angular
          .module('app')
          .config(routes);
  
          routes.$inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider', '$httpProvider'];
  
          function routes($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
  
              // Configure app states
              $stateProvider
  
                  .state('app', {
                      abstract: true, 
                      templateUrl: 'modules/app/app.html',                
                      controller: 'AppController'
                  })
  
                  .state('app.home', {
                      url: '/',
                      templateUrl: 'modules/home/index.html'
                  })
  
                  ;
  
  
              // Set 404
              $urlRouterProvider.otherwise('/404');
  
          }
  })();
  </code></pre>