Chapter 4 - What is Laravel?

Raise your hand if this sounds familiar

You’ve been tasked with adding a feature to your company’s existing system. Unfortunately, the system was written in PHP 4 and whoever the original programmer was, you suspect they watched a few too many “Wordpress Gone Wild” videos.

You’ve inherited this codebase with *gasp* no classes, a glut of global variables, and a structure not unlike a 50,000 piece jigsaw puzzle.

You curse your job, the short sightedness of the management-team, and whatever possessed you to want to make money by programming in the first place.

After all, programming should be fun. Right?

We’ve all been there.

Enter Laravel.

(Cue the sound of kettle drums: duh-duh duh-duh duh-da-duh)

Laravel is a framework for PHP which makes programming fun again.

Come on man … it’s just a framework

Laravel is not a new language. It’s only a framework. If you cut through all the hyperbole and look at its essence, Laravel is simply a PHP Framework.

Although, I do agree with the motto from the Laravel web site:

The PHP Framework for Web Artisans.

Ruby On Rails is just a framework. Yet look at the fandom behind it.

Laravel’s not going to magically fix your PHP spaghetti code, but it provides you with a new, fast and elegant way to get stuff done. (Note, the concept of Getting Stuff Done is a reoccurring theme in this book.)

In short, Laravel provides you with an architecture that makes PHP programming a joy. You’ll be able to refactor existing code in a way that is expressive, stylish, and will be easy to maintain and expand in the future.

Laravel is not a panacea. If your existing codebase sucks, it’s going to be painful to get from where it is now to where it should be. That’s the nature of our industry.

But, if you want to move to a framework that allows simple expressivity (is that even a word?) then Laravel is the answer.