I’ve been coding in PHP for a few decades, mostly using the CodeIgnitor, which I have grown to love. But today, I’m breaking from the old ways and adopting a framework that’s been on the rise for many years: Laravel.
Ironically, I’ve layered on many of the basic features of Laravel over CodeIgnitor as I extended CodeIgnitor’s framework for my use. Not as clean, not as well architected, but the basics were there. But seeing Laravel’s implementation made me realize how mine paled in comparison.
If you’re considering switching, I’ll advise you that its design is “opinionated”. This means there are rules, like keeping a Model (it’s an MVC framework) filename singular but the database table plural. While you can override things like this if you follow their conventions, things, as Steve Jobs used to say, “Just Work.” For instance, is that example my Model is almost empty. There’s the shell of a class but nothing else. Yet I can go into a controller, reference the Model, and query the database, even though the Model looks unfinished.
The “opinionated” nature of Laravel makes it very quick to code, but (and here’s the catch) you need to learn its conventions. Following these conventions allows all kinds of magic to happen in the background and allows for less code that’s easier to read, which is a win for both the programmer and the next person who has to read their code.
Add in the incredible ecosystem of packages that extend Laravel, and you’ll find this like writing CRUD for a table more of configuring, and less of coding. While its list of packages is growing, I’ve only once found something I needed that wasn’t already coded and free or reasonably priced. I’ll discuss a few of of this in another Post.