Laravel: Routes or Controllers

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

This question pops up quite a bit from (mainly) newcomers to Laravel. It's understandable too, especially if coming from another framework that only offers the choice of controllers. The documentation doesn't explain which is best to use, only how to use them. So it often leaves the reader wondering what's the best? What are the pros and cons? What do others use?

Continue reading »

Laravel: The Story Behind The Name

Posted by Jason Lewis in Laravel on

I was sitting in IRC today having a dandy of a time when the question popped up...

Does anyone knows where the name "Laravel" came from?

Not a hard question. But a lot of people don't know how this sexy name was conceived. What does Laravel mean? Is it made up? What was Taylor thinking? I'm pretty sure it was along the lines of: "Man, that sounds sexy!"

It's not a new question either. It's been asked before, numerous times. In fact, Taylor answered the question a long time ago. Here's what he said.

Taylor Otwell
When trying to think of names, I thought about the geography of Tolkien's Middle Earth and C.S. Lewis' Narnia. In Narnia, Cair Paravel is the name of the castle where the kings and queens of Narnia live. Laravel rhymes with Paravel. I thought the name had a classy and sophisticated ring to it.

But what if Dayle Rees has the right story behind the name. Just because Taylor said he was watching Narnia when he had a eureka! moment doesn't mean it's true!

Dayle Rees
Well you see, the name came to me, when during a Skiing holiday with Lara Croft, an unfortunate tumble led to me becoming Enveloped within her ample bosom. I had become Laraveloped.. which clearly led to the name Laravel.

I guess I'll let you decide which seems more likely. I mean, we all know how many skiing trips Dayle has been on with Lara Croft. TEN!

Now, go code something dammit! Enjoy!

How To: Contributing to a GitHub Project

Posted by Jason Lewis in Laravel on

We've all been there. You're sitting down having an amazing coding session without a care in the world when suddenly an ugly bug rears its head from the depths of Laravel. First thing that comes to mind: god dammit! After a while (sometimes it's longer then a while) you find the source of the bug and luckily for you it's a relatively simple fix. So you patch it up on off you go on your merry way.

"Wait up there, you selfish person you!" says your conscience. "You're just going to leave all those other wonderful, brilliant, and amazing Laravel coders to fend for themselves!? They need you mon!" Wondering why your conscience seems to be Jamaican you decide to submit an issue on GitHub. But didn't you just fix it yourself? Why not contribute your fix to the community and save others the time. That sounds like a much better idea, ninety nine!

Continue reading »

Laravel and Eloquent: Basics

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

Eloquent is the name given to the super slick ORM that is shipped with Laravel. For those that don't know, ORM stands for Object-relational Mapping. It provides a way of accessing your tables as objects. It's super awesome!

An ORM allows a developer to produce applications quickly and, if the ORM is good, efficiently.

Continue reading »

Laravel: Keeping Things Organised

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

As an application grows you begin to see things become unorganized. Your start.php file is filled with a mixture of filters, composers, named views, events, validations, macros, and autoloadings. Everything begins to become a mess, more so now since Laravel ships with the start.php containing a bit of logic. A lot of the above mentioned code can go in routes.php, but if you're like me then you'll prefer to keep only routes in that file.

Continue reading »

Laravel: Controller and Route Layouts

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

In todays application development it's a fairly common practise to have a layout that is used across the vast majority of pages. Most of the time you can just use View::make() and bind data to your layout. But that's not a robust solution. Later on you might change your layouts file name from layouts.core to layouts.main or you might want to make it easy to switch between layouts.

Continue reading »

Laravel: Using Forms and the Validator

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

Forms are an essential part of any web application. We use them for logging in and registering users, requesting feedback, submitting comments, and many other things. However, building them and then validating the submitted data can become a nuisance. Laravel provides us with some neat classes to make things more intuitive.

Continue reading »

Laravel: Getting Started

Posted by Jason Lewis in Laravel on

This article is about Laravel 3, some principles may apply to Laravel 4.

Almost one year ago a beautiful and expressive PHP 5.3 web applications framework was released to the world. It's name is Laravel. Laravel was created by Taylor Otwell to be an extremely powerful yet flexible framework that anyone (with some knowledge!) could just pick up and use. Since its birth Laravel has grown with the help of many contributors to become what it is today, one of the best framework choices for PHP.

I aim to provide Laravel tutorials and code samples every now and again when I get the chance. Today I'll talk about getting started with Laravel and setting up a new project with Git.

Continue reading »