I’ll be setting up a server that will host several laravel applications. There will be a few ones at the beginning, but with time we can end up having dozens of them. Most of which (if not all) will be laravel projects.
I’m not sure how to organize all this. I have several choices:
-
Use a different laravel project for each application. Every application would be placed in a different directory. That would mean lots of files and space taken up by apps.
-
Use a single laravel project, having a
srcfolder inside the project where I would be placing each application in a separate subfolder. Each of these subfolders would contain only the service provider(s) of each app, as well as their own routes, controllers, rules, etc. -
I’ve been told lately of an approach similar to the second one, but instead of placing the apps in
srcdirectory, each app would be developed as a library, and the main laravel project would require each one of them. That way, apps would be invendordir, and could easily be required or unrequired. -
I can also group applications across a few laravel projects, using either approach 2 or 3.
What are the advantages and inconvenients of each one of these approaches? Is there an optimal approach to this problem?
Thanks!
>Solution :
If they are different and not connected in anyway, the best thing in my opinion is to have their own seperate projects because it would be easier to deal with the webserver (like nginx) and the other options would just make everything more complicated.