For routing Laravel, you can use something like this:
Route::group(['prefix' => 'subapp1'], function() { Route::get('route1/{id}', ' SubApp1Controller@show '); });
Your decision is likely to be a pain for future management. This creates complexity and duplication without buying you in terms of functionality. I would make sure that you have a really good reason for this, in addition to the fact that itβs easy for developers to work independently, because you can still have this with the following approach.
I would suggest using one Laravel application to handle all routes using a separate controller (or controllers) for each additional application. This will be easier to maintain and still allows developers to stay in their files so that they do not conflict with each other. The exception will be routes.php , but you can define routes up so that developers do not all edit it.
I prefer to keep Angular separate from Laravel by putting Angular code in a shared folder, but it depends on how much you plan to do with Blade vs. Angular It's hard to say without knowing more about your applications, but you can leave most of the work in Angular, and Laravel will just send the source page.
This avoids conflicts with Blade vs. Angular and supports disconnecting an Angular application from Laravel. But if you decide to keep Angular in Laravel views, be sure to handle it somehow. A few common solutions are to change the delimiters from the {{ }} or prefix Angular expressions with the @ symbol as follows: @{{ user.email }} to prevent Blade from being parsed.
Here you can lay out the directory structure:
app/ Http/ Controllers/ AppBaseController.php # API that will be used across all apps SubApp1Controller.php # sub-app1 specific API's SubApp2Controller.php # sub-app2 specific API's ... public/ bower_components/ angular/ bootstrap/ scripts/ angular.Modules.js # custom modules to be used across all apps AngularApp1/ # SPA for sub-app1 AngularApp2/ # SPA for sub-app2 ... resources/ views/ ... # landing page view sub-app1/ ... # sub-app1 views sub-app2/ ... # sub-app2 views
source share