Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
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 src folder 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 src directory, each app would be developed as a library, and the main laravel project would require each one of them. That way, apps would be in vendor dir, 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!
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.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
By default, Laravel's model classes are placed in the App/ directory and models files mess up the App/ directory.
So, I want to create an App/Models/ directory and move all model classes to App/Models/.
And there are many articles in the internet and stackoverflow answers about how to do that.
My question is whether it is a good practice or bad practice to move models to App/Models/ in Laravel?
Laravel doesn't do it by default, so I think it should be a very bad practice because it is said that Laravel gives developers the best practices, and I'm afraid that moving models to App/Models/ causes troubles in the future while developing.
If it is a good practice, why doesn't Laravel do it by default?
It is completely okay to do like that. Always I create separate folders for Frontend, backend controllers also. In Models also you can do as per you wish. Only thing is you have to define namespace depend on that.
That is not quite right. Since Laravel 8, the models can be found under App/Models. And I think it's better that way.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have several Ruby scripts that have been refactored to use common methods. What folder structure should I use for these files?
For example: I have reports "Grower", "Fecal", "30Day", "30DayFecal", etc. that all use methods in files "date_of", "get_fecal_data", "get_fy", "chart_fecal", etc. I'm thinking that I should set up folders like;
App
-Grower
-Fecal
-30Day
-30DayFecal
-lib
-date_of.rb
-get_fecal_data.rb
-get_fy.rb
-chart_fecal.rb
Please advise.
Seems you're being partially influenced by the Rails folder layout.
app
models
controllers
views
lib
...
You can use that, since it is a common way to think, and will aid you getting advice from others. Just be sure to make it clear that you're not developing a Rails app, so you don't create other confusions.
Views
These can be any output-formatters. Rails app commonly export data in .csv format, for instance.
Controllers
These, along with services and related concepts, are things that manipulate data after a Model has retrieved it from a 'store' (e.g. a file on disk, database, or anything).
A common convention is that Controllers depend upon Models, whereas Lib[raries] is self-sufficient. Some would say that Services depend upon external API data.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I have a lot of codes in libraries, helpers, models of my old codeigniter projects.
I want to start a new project that I think I can use those codes without rewriting them. Also, when I want to update the codes in the libraries, helpers or models, I only have to update them once in one file. However if I copy and paste the file to the new project, I have to update each of them when I have an update in the code.
So how can I do this in best practice?
Thank You
Have a look at theis article by Phil Sturgeon - in it he details a way to create a 'shared' folder, so that you can run multiple codeigniter installations from the same shared folder.
http://codeigniter.com/forums/viewthread/136321/
Since Codeigniter 2.0 you can share same system folder among many projects. In previous versions you can do this with a little tweak. So once you have a common system folder you can keep all you libraries and helpers here which can be used by all the projects. There is no provision to have common models so either you can transform them to helper or library class, which actually makes sense.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I want build an application by using the framework.
the application contains two parts: the Back-End and the Front-End.
Everybody who have experiences can suggest me which ways should I do?:
Develop the Front-End first Or Develop the Back-End first
Or give more tips on the start up project?
thanks
I usually start with the backend to get the major functionality implemented, but even so, it's pretty much inevitable that the frontend and backend will have to be developed at the same time at some point in the project.
People can say what they want about separating presentation and functionality, and that's a good principle, but the reality is that the presentation influences the functionality and vice versa.
You might get the backend mostly written, and then you make the frontend, but you will probably decide to change some things and end up working on both together.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
My next project will be a lightweight PHP alternative to Trac, since Trac is often confusing to install and is often a little too big or feature-rich for smaller project.
Features planned so far:
Wiki
Bug tracker
Forum(s)
Static pages (easily edited of course)
Markdown support
No code repo hosting (I consider this a feature since most people would prefer to use a 3rd party such as GitHub for the actual code hosting)
My question: if you were to use a self-hosted app for making a website about one of your open source projects, what would you want? Is there anything on that list that's missing? Would you absolutely require the ability to actually host the code repo on the site itself, or would you be ok hosting the code elsewhere (Google Code, GitHub, BitBucket), and using the site only to upload major versions?
Summary: if you were to use a self-hosted app to provide info and support for an open source project of yours, what would you want it to be like?
Redmine is my current favorite, I usually install it via BitNami