I am trying to combine a SPA angular app based off of Mobile Angular UI that can take advantage of Laravel's features like csrf protection. I can place the entire AngularJS app in Laravel's public/ directory, but I'm not sure if that is the right way of doing it.
What I'm looking for is guidace on how to be able to serve an index.php that can interact with Laravel from which a single page AngularJS app would take over. In my case, Laravel is an API for the single page app.
The problem:
- Laravel route is defined for
/app3which returnsindex.phpfromtemplates/
Of course, I'd prefer to define the route for /app, however, all AngularjS assets are located in public/app/ and requesting app/ returns a default directory listing since there is no index.php/html in /app. Simply placing index.php in public/ results in a blank page since for some reason, the PHP never gets parsed by the server. Changing index.php to index.html works, but then how can I take advantage of things like Laravels csrf protection?
index.phploads all AngularJS resources correctly and without console errors.Clicking on a sidebar link from
index.php, which normally returns an AngularJS template which should be placed insideindex.php, instead, loads the default directory listing shown when a directory contains no index.php/html.
Why do the AngularJS templates fail to load inside index.php?
What is the best way to combine a single page AngularJS app with Laravel?
/app3