title: Laravel 4 and AngularJS - clean URL's with routing
body: <p>I'm new to AngularJS and having a hard time getting it to work smoothly with Laravel. I am trying to create a back-end application for a website and want the routes prefixed with '/admin' to all be managed by AngularJS without the hash in the URL.</p>
  
  <h2>Laravel's Back-end</h2>
  
  <p><strong>Routes</strong></p>
  
  <pre><code>Route::group(['prefix' =&gt; 'admin'], function()
  {
      Route::get('/', function() {
          return View::make('backend/dashboard');
      });
  });
  </code></pre>
  
  <p><strong>View - dashboard.blade.php</strong></p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="glenn"&gt;
  &lt;head&gt;
      &lt;title&gt;Laravel and Angular Together&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
  
      &lt;base href="/admin"&gt;
  
      &lt;script src="vendor/angular.js"&gt;&lt;/script&gt;
      &lt;script src="vendor/angular-route.js"&gt;&lt;/script&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Dashboard&lt;/h1&gt;
      &lt;div class="container"&gt;
          &lt;ng-view&gt;&lt;/ng-view&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>AngularJS Front-end</h2>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var glenn = angular.module('glenn', ['ngRoute']);
  
  glenn.config(function($routeProvider, $locationProvider) {
      $routeProvider
          .when('/test', {
              templateUrl: 'test.html',
              controller: 'TestController'
          })
          .otherwise({
              redirectTo: '/'
          });
  
      $locationProvider.html5Mode(true);
  });
  
  glenn.controller('TestController', function($scope) {
  
  });
  </code></pre>
  
  <p>Problem: when I direct the browsers url to admin/test, then I receive Laravel's <code>NotFoundHttpException</code> because Laravel is trying to take over the routes that I want Angular to take care of...how can I fix this? Thanks</p>