I'm trying to understand the benefits of fat models and skinny controllers notion. I've read many articles so far and below are my questions. Please answer the questions considering what's the best approach in CakePHP 3 and laravel 5.2.
1) Does following fat models/keeping the business logic inside controllers notion simply means never to use the ORM methods like find, save, etc inside the controllers.
2) Why do all the examples in cakephp and laravel documentation show queries inside controllers only and not inside the custom model functions which should be called in controllers.
3) There are many patterns and architectures like datamapper, repository, active record. Which one is best for a large scale enterprise applications. Is it better to go with Doctrine in such case rather than the bundled ORM's ?
4) What if i need to call another model inside a custom model function. Is that okay? if not then what should be the best approach in such case. Please explain with an example like cakephp doc uses blog,user, comments, etc
Thanks.
You're asking some pretty broad questions here so expect broad answers. To give you some insight from my experiences: