V
V
vanek_parenek2022-02-28 12:20:07
Software design
vanek_parenek, 2022-02-28 12:20:07

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

1 answer(s)
P
pLavrenov, 2022-02-28
@vanek_parenek

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 question

Ask a Question

731 491 924 answers to any question