Lime Blast » Laravel http://limeblast.co.uk The virtual home of Web developer Daniel Hollands, the place to be if you're looking for articles and tutorials (and rants) on all aspects of the World Wide Web. Wed, 14 Oct 2015 13:13:21 +0000 en-US hourly 1 http://wordpress.org/?v=3.9 Laravel Application Development Cookbook /2014/01/laravel-application-development-cookbook/ /2014/01/laravel-application-development-cookbook/#comments Mon, 13 Jan 2014 20:00:21 +0000 /?p=1152

Related posts:

  1. Useful Composer packages for use with Laravel 4By this time next week, I would have (hopefully) survived my first day at my new job, and gone back for more. My new job requires that I learn Yii, which I have been doing, and for the most part......
  2. Web Developer Economics: One Off Software CostsTaking inspiration from a post by Chris Coyer on Web Developer Economics, specifically that of One Off Software Costs I’ve decided to put together my own list of figures. Unlike Chris however, who had a start up cost of $1,779.98, I......
]]>

Introduction

At the tail end of October last year I saw a post on LinkedIn by Packt asking if anyone would like a free copy of their recently published Laravel Application Development Cookbook by Terry Matula. Being the greedy so-and-so that I am, I jumped at the chance to get something for free – the fact it was a book about Laravel, a framework which is currently in the centre of my latest project, made it all the sweeter. Of course, there is no such thing as a free lunch, and in exchange for the aforementioned free copy of the book, I had to write a review of it, which is what you’re reading right now.

I should mention at this point that I’ve only read the first three chapters, so there might be a second or even third part to this review published at some point in the future, but I feel that I’ve read enough (and seen enough warning signs in the way that the book is written) to give my opinion on what I have read thus far.

Laravel

Laravel, for anyone that doesn’t know, is a PHP framework developed by Taylor Otwell and popularized by Jeffrey Way (at least, it’s because of Jeffrey Way that I know about it). Taking advantage of the latest features available in PHP’s arsenal, not least of which being Composer, a dependency manager which takes the hard work out of using third-party classes, Laravel is at the cutting edge of what PHP can do.

One of the things that I like about Laravel is that anyone with experience writing PHP can pick it up and use it with ease. That’s not to say there isn’t anything to learn about the framework (there is a hell of a lot), rather, whereas Frameworks like CakePHP and Yii have their own, propriety and overly complicated ways of going about thing such as using modules/addons/packages/classes, the PSR standards which Laravel adopts (thanks, in part, to Composer) are super simple. Combine that with a whole host of cool ideas and features, and you’ve got yourself a fantastic little framework.

The Book

Unfortunately, while I would love to sing this book’s praises, I found too many examples of sloppy code and poor explanation within the first three chapters to do this.

An example of this, early in the first chapter, is the task titled “Installing Laravel as a git submodule”. While I can’t fault the method presented within the book for achieving this, I’m a little confused as to why this task even exists, as frankly, it’s just a bad idea. The Laravel framework itself is a Composer package, and is both installed and autoloaded via it, so to ignore this system in favour of a git-based one, which would make updating it much more of a chore, just doesn’t make sense. If this book was for a framework like Yii, then it would be a perfect fit, and I’d be applauding it for including it, but here, it just leaves me with the impression that the author doesn’t understand Laravel.

The next task, designed to help you set-up a working server environment, is no better. Here the author knows that PHP has a built-in server, but rather than teach you how to use it, instead focuses on setting up a full stack environment. OK, so I don’t really have a problem with this in itself, but I do have a problem with the approach he takes, specifically that of recommending wampserver. For what it’s worth, as a Windows user, I like wampserver, and have been known to use it from time to time. The problem with wampserver is that it only works on Windows, and the author fails to provide Mac or Linux users with any useful information on how to do the same on their respective platforms.

The other problem I have with this approach is that a better alternative exists, that of Vagrant, a cross-platform solution that makes it easy to create virtual machines running whatever server software you need. You don’t even need to worry about learning how to configure Vagrant or the virtual machines it hosts, as tools such as puphpet, or pre-configured systems like Laravel4-Vagrant make it easy.

The next few tasks and following chapter were better, with some useful information, although none of it was ground-breaking, and most of it I already knew from other sources. I was disappointed that none of the examples I’ve read so far included anything about Blade (Laravel’s template system), although this could have been to try and keep examples simple (not that Blade is complicated).

Conclusion

Now maybe I’m being unfair in this, seeing as I have only read about a quarter of the book, but based on what I have read, I’m not filled with confidence in the quality of what lies ahead, (this is partly why I have only read three chapters). It is for this reason which I’m finding it difficult to recommend this book. I do plan on finishing it, as it will no doubt have some useful information, and parts two and three of this review (if they ever get written) might contradict this opinion, but until that happens, I’d say borrow the book from a friend rather than pay for it yourself.

In the meantime, if you’re looking for a good way of learning Laravel, you can’t go wrong with Laracasts.

]]>
/2014/01/laravel-application-development-cookbook/feed/ 0
Useful Composer packages for use with Laravel 4 /2013/07/useful-composer-packages-for-use-with-laravel-4/ /2013/07/useful-composer-packages-for-use-with-laravel-4/#comments Tue, 16 Jul 2013 12:33:25 +0000 /?p=1119

Related posts:

  1. I love you Jose Diaz-GonzalezThis is a very quick post to thank Jose Diaz-Gonzalez for the Upload behaviour he wrote for CakePHP. I needed a way of uploading multiple images in the admin area of the Chameleon Photography site. During my Cake 1.3 days,......
  2. How to use Couch CMS with GitAfter around a year of using WordPress for the majority of the websites I built for Ghost, I was looking for something different. That isn’t to say that WordPress is bad – it isn’t – it’s just that for some......
  3. CSS CrushAlthough there is a lot of love for CSS preprocessors such as LESS and SASS, both of which seem to work very well, I wanted to take a moment to talk about a slightly different alternative, the PHP-based CSS Crush. Much......
]]>
By this time next week, I would have (hopefully) survived my first day at my new job, and gone back for more. My new job requires that I learn Yii, which I have been doing, and for the most part have found to be a perfectly suitable framework for dependable web apps…

..but I would be lying if I didn’t admit to flirting with the sexy new framework going by the name of Laravel 4.

Laravel?

I first learnt of Laravel by reading articles published by Jeffrey Way in Web Designer magazine. It is a framework which takes advantage of the latest developments in PHP (such as Composer), and makes building sites more.. well.. fun!

This isn’t a post about explaining how great Laravel is however (I’ll let Jeffrey do that). Rather, this is a post, primarily aimed at myself, to list all the useful composer packages which I’ve found during my time learning the framework, and as I’m still learning the framework, as I find new and existing packages, I’ll try to keep this post updated accordingly.

Packages I’ve used

JeffreyWay/Laravel-4-Generators

This is the first of three packages created by Jeffrey Way which I’m going to recommend. It builds upon Artisan by adding a number code generation tasks to it. One of the things I liked about CakePHP (back in 2006) was it’s Bake feature – and this is the closest thing I’ve found to it in any framework (although, I have seen that Yii also offers something similar).

JeffreyWay/Laravel-Guard

I’ve been a fan of Guard since I discovered it’s ability to automate a large amount of your workflow simply by watching for file changes and acting accordingly, i.e. you can set it to automatically compile Sass files before livereload‘ing your screen. This package makes the process of configuring Guard for use with Laravel really simple.

JeffreyWay/Laravel-Test-Helpers

I don’t know much about Test Driven Development, but I’m currently learning how to do it (thanks, once again, to Jeffrey Way), and I know enough to make me want to use the technique for everything I build. This package helps simplify the process by offering a number of shortcut methods for the tasks you’re most  likely to do.

barryvdh/laravel-ide-helper

Although I’ve been trying to get into the flow of using Sublime Text 2 for coding, I keep reverting back to PHPStorm for a number of it’s features, one of which being code autocompletion. The problem I’ve found, however, Laravel’s facades paradigm prevents this from working out of the box. This package seeks to rectify this problem by creating  a docblock helper file which the IDE can take cues from.

Packages I’ve not used… yet

…and more can be found at the Laravel Packages Registry (thanks Luke).

(Featured image by rafdesign)

]]>
/2013/07/useful-composer-packages-for-use-with-laravel-4/feed/ 2