PHP has come a long way. A very long way. There was a time when Ruby developers could run circles around those of us who chose to cast off that repulsive language and pursue the former for its benefits — and by benefits I mean exclusively WordPress.
Yes, once upon a time, Rails devs were able to type some magical commands into their terminal, and mysteriously have a working blog in about three seconds, turning, sardonically gazing over at your desk, slowly eating their bag of chips, wondering why on it was taking you so long to do the same in PHP. That guy was a real jerk.
But all that shame and embarrassment is behind us now. Nowadays, PHP has a plethora of sophisticated, robust frameworks to build your latest web apps from. Laravel is fast becoming my favorite of the selection for multiple reasons.
Most importantly, Laravel is an MVC framework, which, if you aren’t familiar, just means it separates the models for controlling logic, controllers for directing that logic to the view, and the view for outputting the appropriate response to the browser. If you’re not already using an MVC framework for your web apps, you should start immediately. Not only does it give you a tremendous amount of control and portability, it also makes collaborating with multiple developers in multiple disciplines a cinch. And it’s all around better, so do it.
Well, that’s nice, but in reality, there are quite a few MVC PHP frameworks to choose from. What makes Laravel special?
Laravel uses RESTful routing, which makes routing your applications easy for multiple input types, whether that’s a GET request, a POST send, or whatever else your app or API will need.
Laravel comes with Eloquent built in. If you really fear having to write raw SQL, this library can save you a ton of hours you might spend trying to make your PHP data interface with a database.
Keeping down the risk of accidentally erasing data form a database is a common concern for enterprise apps, so Laravel’s migrations and database seeds makes doing just that simple and future proof. Any changes you might need to make to a database can all be written into a migration and then subversioned, then executed when the production version of the app is deployed.
Laravel has generators. That’s right, you can look like a computer hacker from CSI, too, using Laravel’s Artisian CLI! Need me to hack into the bank and steal a bunch of credit card numbers? No problem, I’m using Laravel! (You can’t really do that. Don’t try.) Generators are a fantastic way to get a lot of code written quickly, and, well, without writing it. The less code to write, the better, right?
Laravel’s documentation is generally impeccable. And on the rare occasion it’s not, Jeffery Way from NetTuts+ has you covered. With dozens of tutorials and those generators I mentioned, he’ll show you the way to becoming a Laravel master ASAP. Which is great news for that app you have to have built this time next week.
So, finally, not only can you be more productive when creating PHP apps, you can look as cool as those Ruby developers, too. Be sure to rub it in their face, they hate that. They’ll try and fight you, probably to their grave, but you can know deep down inside that our time as PHP developers has arrived.