mardi 9 octobre 2018

About 20 Models in 1 controller Laravel app

Does it affect the performance, If I use my all models in 1 controller file, rather than separate controller file for every single model?

I have 20 model file in my Laravel app and instead of calling routes for every different model in a different controller.

I am planning to use - 1 "HomeController.php" controller for all routes including my all required model in it.

For instance, I have models like "Game", "Player", "Reviews", "Product", "Tournament", "Leaderboard" and other models.

I have 117 routes and for each route, I am using HomeController@someFunction where someFunction is separate function Name for each routes.

Will this affect the performance of my app? Or should I choose a separate controller for each model?

Update: In localhost, I don't see any difference.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire