Answer the question
In order to leave comments, you need to log in
What is the best way to store models in Laravel?
I am creating a project where there will be many models. Can I create my own directories in the App\Models directory and place the corresponding models there. For example, create a User directory, and put the User, Role, and so on models there. Or should all models be located only in the Models folder?
Answer the question
In order to leave comments, you need to log in
You can do as you wish. Until recently, Laravel did not have a Models folder at all, although one of the first steps was to add a Models folder. There are no restrictions.
A large number of models will lead to the inconvenience of constantly scrolling this folder in the IDE (because it is almost always open).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question