I worked with CakePHP since Version 1.0 and we have gone a long way up to CakePHP 3. I would say that I have now 5 years (maybe even more) experience with CakePHP. Most of it in CakePHP 3.
Of course I noticed the trend with Laravel and Symfony. So I thought: "Ok the next small project I will do with Symfony".
I learned symfony and it's components and what I can say is: It's a very verbose framework. It was no issue but having more code for doing things you could solve with a convention over configuration looked not that nice to me. You need a pagination(helper)? Search a plugin for that, not core. And I dont like Twig. In my opinion PHP itself is already a template language. And doctrine seemed to me like the most powerful annoying orm.
Some months later the next little project came up:
This time I wanted to use Laravel. It was actually more convention over configuration but what did the Laravel devs smoke at some code parts? Eloquent-App-Model is basically a god object, Facades are an excuse to write static classes everywhere, Global helper functions, magic here magic there, magic bootstrap function, active record instead of data mapper. Laravel looked to me like wordpress. It is famouse and convenient but the underlying code and concepts were not that awesome.
Today if I need to start a project from scratch again I would use CakePHP not that CakePHP has no flaws (overusing traits, no dependency container, Helper-Classes which should be utility classes and so on...) but nevertheless it feels very rounded to me. Ecspecially the ORM, Phinx, Controller (Component)- and Model(Behaviour)-Part. Am I a fool for thinking CakePHP is still the best framework?
PS: Maybe my brain thinks to cakeish to see the benefits of the other frameworks.
5 thoughts on “I tried Laravel and Symfony but CakePHP feels just right – Am I a fool?”
No, you aren’t a fool and using those other frameworks helped you realize the pros/cons of those frameworks and how they went about solving problems in their own way. I wouldn’t really compare symfony to laravel and cakephp since symfony is more of a library, rather than a framework.
CakePHP and laravel go about solving the same problems and have different mechanisms to do so. Given your experience with CakePHP I would say stick with it for your goto PHP framework, and continue looking at how other frameworks solve similar problems and if you want to contribute and help CakePHP be better, use those other solutions as a basis.
If you don’t really care for backend stuff, I would suggest increasing your skills with frontend frameworks if you haven’t been already.
A framework is a tool for building applications, all the above framework s do it on a different way. The end result however is the same thing a web application.
I worked with CakePHP indeed it has no dependency injection and helper class but that is not batering me, the most annoying things are the unclear documentation (website and doc blocks) and decepreacted methods.
Guilty to an extent on that one. Suggestions / patches for reducing trait usage are welcome.
>no dependency container,
CakePHP internally uses the locator pattern and hasn’t needed a DIC. But providing support for DIC is on the roadmap [https://github.com/cakephp/cakephp/wiki/4.1-Roadmap](https://github.com/cakephp/cakephp/wiki/4.1-Roadmap).
>Helper-Classes which should be utility classes
Can you provide examples please? For e.g. `TimeHelper` and `NumberHelper` are there mostly for legacy reasons. You can directly use the `Time` and `Number` utility classes in your views. The unneeded `SessionHelper` has been deprecated in 3.x as one can get the session from request.
All PHP frameworks are unique in their ways, they all have incredible features for that they are famous. Laravel and [Symfony Development services](https://www.w3care.com/technologies/php-frameworks/symfony/) are best and trending too but you feel that Cake PHP is more easy and convenient for you and your project than its good. If you like CakePHP due to its extraordinary features than you are not a fool or wrong in any way. Use which PHP frameworks you like to work most and make it best.