sahat/satellizer — pull request #70 by Foxandxss (2014-08-28 11:03:04+00:00)
Title: Update route for angular and .gitignore

Leaving `composer.lock` into `.gitignore` is not a good idea. I know there is a `.gitignore` file with that insde (the one you got probably, but that is meant for the framework and not for apps. Read more [here](https://github.com/laravel/framework/issues/1412).

On the other hand, INFINITE THANKS, I looked for a `return File::get(public_path().'/index.html');` for AGES, had to create my own `foo.php` for angular and serve it.

Leaving that aside, I also discovered a much better way to serve `angular`. Instead of a normal route that goes to a controller to render a file, you can create a catch all route like:

```
Route::get('{angular?}', function() {
return File::get(public_path().'/index.html');
})->where('angular', '.*');
```

You put it the last, so if none of our routes matches, we render Angular. This is not THAT needed for this example, but if tomorrow we decide we want to use `html5mode`, you need that so when you do `/foo` trying to match that route in angular, that catch-all route will fire and then it will render angular and will give it the `/foo` route so angular can route it.

Also, that allows us to delete the controller.