I’m currently working on a project that involves using Laravel and Angular JS. My initial approach was to have the Angular JS codebase live under the the Laravel codebase. However, from my research so far this seems to create several problems. Therefore, I’m now separating the application into two distinct codebases that know nothing about each other or at least that is the plan. The Laravel codebase will act as rest client that angular js interacts with through http and its own service layer. Does this seem like a good approach or should I try to merge them both together? I can’t really see a downside to this approach myself so long as the Laravel application remains only a rest client and the angular js one the client facing application.
I also have a follup question that fits this topic. The Laravel application lives on the default homestead vm. However, the angular js application will live on a separate vm configured via puphpet. What is the proper way to allow the angular js app to make service requests to the laravel app without running into the same origin policy restrictions?
- Both boxes use nginx instead of apache