Cooking with Laravel

Laravel Application Developer CookbookI’ve recently added a new Laravel 4 book Laravel Application Development Cookbook written by Terry Matula and available from PacktPub to my library.  I would consider myself a very good PHP developer, and have been searching for a framework to help me excel the development process.  I’ve tried a couple in the past (Yii, CodeIgniter) but always felt constrained, like if I wanted to do something it didn’t support ‘out of the box’ it was a headache and required a lot of hacking. Granted this could simply be my impression and not fact, but not having time to really sit down and figure out if this was reality, I just passed over them.  For the record, I do have 2 live apps using Yii, so I didn’t completely give up.  Back to Laravel.

At a conference in Buffalo NY, I sat in a session by Zac Vineyard and he talked about Laravel and it really piqued my interest.  The session was really about Composer and autoloading, but what he had said about Laravel impressed me and it sounded like something I really wanted to  learn and utilize.

To frame this properly, I would consider myself a Laravel beginner, because I still have to look up how to do things, I’m hardly proficient, and am always looking for tutorials, tips, tricks and other material to help me along my quest to achieve an equivalent level I am with “normal” PHP development.  I can’t wait until I can just sit down and let the Laravel code pour out of my brain.  With my obsession to learn this framework, this is now the 2nd book I’ve read about Laravel 4 and I definitely recommend it to anyone that wants to learn.

As you would expect by the name, this is a cookbook.  Tasks are broken down into recipes (think mini-tutorials) that help you cook up the functionality you’re looking for.  Since this is the 2nd book I’ve read, I came in with some (albeit limited) Laravel experience.  I actually performed the first set of chapters so I could solidify the basics in my brain.

The recipes are concise and all follow the same pattern : Getting Started, How To Do It, How It Works, There’s More, and finally sometimes a See Also section. Getting Started sections run through setup steps necessary for the recipe, sometimes building on other recipes, or are prerequisites for other recipes.  The How to do it is a concise tutorial with no fluff.  Numbered steps walk you through exactly what to do, sometimes with code and/or screenshots.  This is followed by a How it Works section that explains what each step does, written in a nice conversational way, almost as if Terry’s there helping you along.  If those weren’t enough, there is a There’s More section of the recipe that may explain some way to extend the recipe, take in another direction or explore an alternate method or change it in some way to really solidify the concept.  The See Also section typically points to related recipes, or recipes that could be cooked together to produce a more robust solution.

The book starts out like most do – obtaining and installing the software and progresses though how Laravel works, learning syntax along the way.  This book is not a Programming Guide to Laravel or a newbie guide for that matter.  Now before you take that the wrong way, a beginner can learn a lot with this book, and I would even recommend it to one.   What I mean is that it does not go step by step explaining how variables work, and ramble through chapters and chapters on language grammar, etc.  This book flat out teaches you how to build an application with blocks of functionality you can easily alter (if you have to) and drop into your projects.  Concepts from recipes can be easily extracted and used however you need them.  That said, if you need (or want) the specific Laravel grammar and methodology, probably the best place to get that is the actual Laravel Documentation.

If you learn and develop like I do (by example) then you have to add this book to your library.  It encompasses so many things you’d be building in your app its not worth the trouble to not have the book (did you follow that?)  I mean, if you need to add authentication to your apps, there is an entire chapter on that.  Along those lines, there is a chapter on Security and Sessions with some great recipes that help you understand the complexities of these types of things, including recipes for setting up a secure API server.  This chapter was gold to me, because I develop mobile apps with PHP services and this really shed a light on how to configure an API with keys and security, covering everything from database table creation through testing it in the end.

No matter what you’re developing with Laravel, I’m certain you’ll find useful bits in this book.  Its a great addition to my new (still small) Laravel library.

Go get it now!

This entry was posted in PHP. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *