Since MVC has three main parts, I would recommend (and notice that almost all the structures on the market do this) to create a directory of each of the three components and put the classes in the corresponding directory.
As for other components, Database is a utility and can be placed, for example, in the lib directory, User is a model and can go to the model folder and Logger / Mailer can also go to the lib folder. These are examples, not something to strictly follow.
As for the instance, each Controller can define a list of models and libraries , it depends on how the MVC structure handles the initialization of these objects. Therefore, you should follow the dependency injection pattern.
source share