Switching From Windows To Linux

Posted by Jason Lewis in Linux on

In the past I've always done my development on Windows. At one stage I had planned to do a series on my Windows development environment but I never got around to it. What a shame.

Don't get me wrong, I never truly hated Windows, although it did have a couple of shortcomings that annoyed me but I always worked around them. Recently though I've just become tired of it. A few days ago I was getting weird results with some unit tests. No matter what I did it just wasn't working, yet at the same time it was working fine on my CentOS server.

So, I did what any sane person would do. I begun trialling a few different Linux distributions to find one I really liked.

Continue reading »

Laravel 4: Diving Into The Source

Posted by Jason Lewis in Laravel on

Those of you that are currently using Laravel in your projects will be aware that when you make a static call like Route::get() you're actually hitting a facade. In nearly every article about facades you'll see the example of what is happening in the background, in our case it's be something like $app['router']->get().

In this article I want to talk about how you can find your way around the source. For many this can be a bit troublesome as you'll go to where you think it is but you end up somewhere else entirely.

Continue reading »

Error After A Composer Update Of The Laravel 4 Beta

Posted by Jason Lewis in Laravel on

When you're developing an application (or anything for that matter) with a product that is deemed "not yet stable" or as it's more widely known, "beta", you should be expecting changes. I'm referring to the Laravel 4 beta but you could probably apply this article to just about any beta phase, ever.

Laravel 4 uses Composer to install its dependencies and other bits and pieces of the framework. That's just bloody wonderful. So all you have to do is composer update every now and again and you'll have the latest changes pulled in, right? Wrong! Dead wrong. That's so wrong that I'm having trouble comprehending the wrongness of it.

Continue reading »

Laravel 4: Develop Packages Using The Workbench

Posted by Jason Lewis in Laravel on

In the early days of Laravel we were blessed with modules. Modules allowed us to separate parts of our applications into more manageable pieces. This meant that modules could contain their own controllers, routes, libraries, configuration, composers, filters, etc. When Laravel 3 was released modules were revamped and renamed to bundles. A Laravel specific bundle repository was setup and developers could publish their bundles so that others could install them with Artisan. It was a great way to easily drop code in to an existing application.

With Laravel 4 hitting beta soon many are wondering what will happen to bundles and how they'll need to be changed to be of any use. There won't be any Laravel specific bundle repository for Laravel 4 since it's now making use of Composer to handle package dependencies.

Continue reading »

Laravel 4: Illumating Your Laravel 3 Applications

Posted by Jason Lewis in Laravel on

This article is about an early pre-release of Laravel 4.

Since you're reading this I'm assuming that you're aware of the upcoming Laravel 4 release. I'm also assuming you've come from some sort of Laravel background, be it version 2 or 3, although for this articles sake I'll only be referring to L3.

At the time of writing (December 2012) Laravel 4 is still under development, although it's at a point where people are beginning to use it and see how it all works. When reading this article take it with a grain of salt as things might change in the official release of Laravel 4.

The aim of this article is to give you, a current user of Laravel, an insight into what's changing in Laravel 4 that you'll need to be aware of, especially if you're thinking of upgrading. Before we crack on I'd like to point out that Laravel 3 is a great product and that you shouldn't upgrade your application just for the sake of keeping up with the Joneses. Right then, let's get started.

Continue reading »

Laravel: Events

Posted by Jason Lewis in Laravel on

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

Have you ever heard of hooks? If yes then you should instantly know what an event is. But let me explain.

Definition e•vent noun

  1. Something that happens or is regarded as happening; an occurrence, especially one of some importance.
  2. The outcome, issue, or result of anything: The venture had no successful event.
  3. Something that occurs in a certain place during a particular interval of time.

Basically an event is something that happens at a given point in time, or in our case, at a given point in our code. Laravel comes with a very easy to use and powerful event system that you can take full advantage of.

Continue reading »

Laravel: Reverse Routing

Posted by Jason Lewis in Laravel on

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

In your applications you often need to create a link to another page, it's a standard thing really. Laravel offers a few ways to do this.

URL::to('/users/login');
URL::to_action('users@login');
URL::to_route('login');

You may have seen the first method used and you may be using this method yourself. If you are I urge you to continue reading as it's not a great solution, especially if you find yourself changing a whole bunch of links because you changed the route for your login page.

Continue reading »

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!