December 13, 2013 - Comments Off on What does Laravel, the PHP framework, have to offer?

What does Laravel, the PHP framework, have to offer?

Laravel is the new kid on the block and it’s fast becoming the cover girl of PHP frameworks, so let’s take a step by step look at what it has to offer.

Built on a number of Symfony components and with an objective of making development an enjoyable and creative experience, it has attracted a large fan base in a relatively short time. Created by Taylor Otwell in 2011, it has already seen three major releases in the last two years alongside numerous updates by Taylor and the large and fast growing community.

By the time version 3 had been released, in February 2012, there were blog posts and tweets singing its praises all over the internet. Now that version 4 has arrived, momentum just keeps on growing!

So with all the fuss surrounding it and an internal PHP project on my hands I decided to try it out…

Installation

This can be a real pain with some frameworks; editing endless config files, setting endless folder permissions, spending days on stackoverflow… Thankfully with Laravel this is not the case – making great use of the PHP dependency manager Composer, installation just requires a couple of lines in the command line.

Learning curve

Ok so installation was a breeze but now I have to learn how to use it, this is where I enter a world of pain, right? Wrong.

Personally, I found that after watching just a few YouTube videos and taking a look through the docs I was able to understand the basics of the framework extremely quickly.

Another great resource were the brilliant articles by Dayle Rees on his Code Bright site. Unfortunately while I’m writing this blog post his site is going through a rough patch, but if you are serious about developing with Laravel then I would highly recommend buying his book, “Laravel: Code Bright”

Blade Templates

There a two options when creating views; raw PHP or Blade templates. The syntax for Blade is very easy to pick up and in my opinion it isn’t that much different from using raw PHP. I chose to use the blade template system but this was entirely an aesthetical decision as I felt that they looked cleaner than raw PHP.

Eloquent ORM

No mention of Laravel would be complete without touching on Eloquent. Eloquent is the ORM (Object-Relational Manager) that comes with the framework and quite frankly it’s wonderful. Due to the modular nature of the framework it can also be used outside of Larvel – double win!

So if you’re looking for a PHP ORM, stop looking and start using Eloquent now!

Artisan

Artisan is handy CLI (Command Line Interface) that comes bundled with Laravel. To be honest, my experience with this was limited, but it was extremely handy when working with the built-in database migrations.

There’s so much more you can do with Artisan and it’s something that I’m excited to explore in more depth very soon!

Conclusion

So after all that information I can finally say that I really enjoyed using Laravel. I was able to able to get working on my project with minimal setup, and using the framework always felt like a help and not a hindrance –a bonus!

The major take away for me was the Eloquent ORM. Although I had heard a lot of good things about it before I started using it, I had always been a bit sceptical as to whether it really was THAT good. Thankfully my scepticism was unfounded and Eloquent ORM lived up to its high billing.

Would I use Laravel again? Definitely.

So, what are you waiting for, go and give it a try!