03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

E-Commerce 223<br />

Once you have Composer working, make a new directory or navigation to an existing directory and<br />

install Laravel 4 with the following command:<br />

1 composer create-project laravel/laravel ./ —prefer-dist<br />

If you chose not to install Composer globally (though you really should), then the command you<br />

use should resemble the following:<br />

1 php composer.phar create-project laravel/laravel ./ —prefer-dist<br />

Both of these commands will start the process of installing Laravel 4. There are many dependencies<br />

to be sourced and downloaded; so this process may take some time to finish.<br />

Installing Other Dependencies<br />

Our application will do loads of things, so we’ll need to install a few dependencies to lighten the<br />

workload.<br />

AngularJS<br />

AngularJS is an open-source JavaScript framework, maintained by Google, that assists<br />

with running single-page applications. Its goal is to augment browser-based applications<br />

with model–view–controller capability, in an effort to make both development and<br />

testing easier.<br />

Angular allows us to create a set of interconnected components for things like product listings,<br />

shopping carts and payment pages. That’s not all it can do; but that’s all we’re going to do with it<br />

(for now).<br />

To get started, all we need to know is how to link the AngularJS library to our document:<br />

1 <br />

If this seems too easy to be enough, fret not. AngularJS includes no stylesheets or any other resources.<br />

It’s purely a JavaScript framework, so that script is all you need. If you prefer to keep scripts loading<br />

from your local machine, just download the contents of the file at the end of that src attribute.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!