Laravel vs CakePHP?

Only when you say something honest and that there is no support on the forum, then suddenly you get a thread with activity.

Otherwise it is like a graveyard outhere.

can anyone who made the switch from cakephp to laravel give feedback of what kind of challenges they faced? Is it mostly a 1:1 translation of ideas or is it very different? Is there anything missing in laravel that you miss coming from cake?

The query Builder in the two are a little different but yet similar enough where code is not that hard to change.

Models in the orm are different but not that difficult at all once you get used to them in laravel.

And the forum is very active, I ask a question one day and got a response within 30 to 45 minutes.

But unlike others I have my own authentication routines I use so no learning curve for me there.

if you use the built-in Authentication and authorization then the learning curve is pretty steep to learn that stuff.

But both are good Frameworks if you know PHP and PDO good beforehand.

The trick is not to try to learn everything in one evening like some people, realize it’s going to take a while.

They actually are working on a Laravel implementation according to their forums though.

I have found if starting from zero, to build a web app, CakePHP is faster to delivery of a project. It’s also easier to pick up for new developers and hence easier to maintain.

Having used Laravel (and Symfony), they require repetition and boiler plate, additional packages to get started (even for CRUD), and the use of annotations for routing is not a good design - a bit hacky. Comments are comments. If you are a web framework, I don’t know why you have to specify routes, the framework should just pick them up like CakePHP.

If performance is an issue, you can scale horizontally/vertically with your servers. Alternatively, you would use Phalcon or Go, or better C/C++.

1 Like

Do you mean reverse-routing like CakePHP does?

Yea. I’ve used Rails and I really love convention over configuration - just getting on with your app and delivering (although in Rails, still have to specify the route manually per action).

https://book.cakephp.org/3.0/en/intro/conventions.html#url-considerations-for-controller-names

I have been using the laravel since the last few months and I observed that it has got rich library functions that helped me to make https://netgears.support/netgear-genie-support

Welcome Nikkij :slight_smile:

I think CakePHP can do most of it as well since it seems like most of it is HTML5 and CSS, not PHP.
The only thing I see that CakePHP can’t do out of the box is that live chat but that’s provided by ZenDesk so…

Used CakePHP to create an online admin app for a not-for-profit to manage membership information. Grown over a number of years and there’s around 140 users who actively use it. Features authentication, user permissions and access control etc.
At the time we started it Laravel wasn’t mature so we went with CakePHP. Still on the v2.x branch - code base is now quite big so looking at the v3.x upgrade with a little trepidation.
Will get around to looking at Laravel one day - but CakePHP meets our needs today and effort to change would be quite big.

Brian

1 Like

I have looked into Laravel again a few days ago (as some friends wanted to start a new project with me, but I had the deciding vote on whether we go with CakePHP or Laravel) and to be fair, the problems I had with using Laravel back in early-2018 (when I tried 5.5 LTS) are still standing there and actually have become slightly worse.
Laravel has so many major versions that had a heavy impact on existing tutorials and codebases that it’s really easy to get lost (and do note that even “minor” versions can contain pretty big breaking changes, seriously, I had multiple apps build in Laravel that broke pretty badly the instant I upgraded them to the latest laravel version).
CakePHP has only 3 major versions.

  • Version 1 is pretty damn dead and I can’t really find much info on it (which, to be fair, can be a good thing).
  • Version 2 is still supported, with quite some information on it, though you can get lost at times when using version 3 (especially if you’re just starting out)
  • Version 3 is the current recommended version, with quite some information on it (and quite some information from version 2 can quite easily be adapted to version 3 if you know what you’re looking for)
  • Version 4 is currently in the works and according to what I’ve heard (and I need a citation on this because I can’t find the source), migrating from 3.x to 4.x should be fairly simple.

To add to this, Laravel has a pretty rapid release life-cycle for breaking versions, averaging about 1 year.

While I love some of the features Laravel has, I personally feel like the tradeoffs on them are just too big.
Some of this features include (but are not limited to):

  • Blade* (templating engine)
  • Laravel Echo* (WebSockets, like Ratchet, but less tricky to implement)
  • Homestead* (all-in-one development environment)
  • Cashier** (billing)
  • Statamic** (CMS)
  • Cachet** (Monitoring)
  • Mix** (Front-End stuff like SASS and WebPack)

I’m currently mainly working on a in-house CMS for my company using CakePHP and so far, using CakePHP feels really nice (albeit with some challenges at times).

* = Seriously, we could use something like this
** = Would be nice to have

do note that even “minor” versions can contain pretty big breaking changes, seriously, I had multiple apps build in Laravel that broke pretty badly the instant I upgraded them to the latest laravel version

Laravel doesn’t follow semver and their “minor” are effectively “major” version with breaking changes and minor version bumps occur too often.

To add to this, Laravel has a pretty rapid release life-cycle for breaking versions, averaging about 1 year.

CakePHP might be slower in churning out new versions but we are big on providing continued support for major versions. We have kept supporting v2 years after v3 release. Not to mention each minor release is backwards compatible and at times only needs minor tweaks in config at best.

Blade* (templating engine)

If you prefer using a template engine over CakePHP’s PHP templates then we have a community plugin for Twig which is well supported. In fact bake templates are in Twig uses that plugin.

2 Likes

As @ADmad mentioned, there is already support for Twig, you just need to install the plugin and go wild. Most CakePHP developers are still very much of the opinion that PHP is already a templating engine, so why reinvent the wheel?

We’re looking at implementing WebSockets soon(ish) at work, so maybe I can convince the boss-people to allow us to open source a CakePHP based something.

There is cakebox, but it needs some serious polish. As with most things, somebody needs to take the lead!

Go forth and contribute :smiley: Seriously, we’d love to see community contributed projects that implement those sort of things!

I do take it from this that you mean the WyriHaximus/TwigView plugin?
If so, I’ll have a look at it :slight_smile:

That’d be dope considering Ratchet is kinda finicky to use with CakePHP right now as far as I could get.

I’m more of a Docker person myself but I’ll see if I can adapt my general stack to be re-usable by projects other than my CMS.

As I already mentioned, I’m currently working on a CMS myself at work.
But since I’m the only one working on it (due to lack of developers at my workplace), I am considering to open-source it.
Later, I’ll have a look to see if I can make something like Cachet and Mix since those are quite important imo anyways (currently Mix is done by a seperate Docker container).

@FinlayDaG33k all the stuff you mentioned above, you may as well use laravel, you basically described laravel.

Remember two different frameworks. Furthermore, if cake doesn’t have something you want, and if you know programming, you can program it in.

That’s part of the problem, everyone wants everything included. I have used a custom framework for years, and things like csrf protection, RBAC, etc, I programmed myself.

If cakephp all of a sudden was congruent to laravel, then why even have both frameworks available. They would be equal.

It did basically describe Laravel, however, I don’t like Laravel much.
Didn’t like their community much (they where very rude and didn’t try to help me out much), had to update my app all the time just to keep up with the Laravel versions (at times I spend more time to actually keep my app working over adding new features), Artisan didn’t work nicely here (dunno why this happened, which is why I turned to their community, which didn’t help out much) and I can’t use Vagrant (so Homestead was out of the question) since I need Docker for other projects (and since I run on Windows for my home workstation, I also need Hyper-V).

and yes, if Cake has something I want and I know programming, I could program it, however, due to my work and other activities/projects, I simply lack the time to do so and maintain it.

I somewhat disagree because I was always able to get my answers within reasonable time thanks to a combination of Google/Stackoverflow + CakePHP Github + Cookbook + CakePHP API and source code.

The latter is a last resort option that almost never fails: you can find exactly what framework does by looking at its source - unless you’re one of those clueless Stackoverflow newcomers who expect others to do their homework and babysit them, in which case yeah, can see your point

2 Likes

I think there are a few specific cases where I had to wait an entire week before I got a usable answer here on the discourse.
I barely ask anything on StackOverflow because I keep getting postblocked for asking “bad questions”…
The cookbook is my #1 source and else I go check the sourcecode (or atleast, the api pages) to see if I can find what I need there.
If I can’t make any sense out of it I come to ask here.

This is my #1 annoyance here on the Discourse (and forums in general)… some people just ask us to basically do their homework without providing much details…
Basically going like: “need help building X fast pls” (I’ve quite literally seen that come by a few times…)
But those people are on any forum really :stuck_out_tongue:
Mean, we’re a community support forum, not a free Fiverr :stuck_out_tongue:

1 Like

This is correct. I feeled the same.

@FinlayDaG33k Don’t forget to join us on Slack too: http://cakesf.herokuapp.com/, for simple questions you can often get an answer in minutes.

1 Like