Updating/Adding packages via Composer

So you found a fantastic new bundle* package and want to add it to your Laravel 4 installation. Here’s what steps I just took to get it done.

* Bundles were used prior to Laravel 4. If you are looking at a bundle, it isn’t compatible with Laravel 4, by default.

The fantastic package that I just had to have was Imagine, an image processing package.

Depending on your server configuration you may or may not need to type php before any of the scripts below.

If it’s been a while since you’ve added a package to your site, it would be a good idea to make sure you have the latest and greatest Composer.

php composer.phar self-update

Navigate to your project’s laravel directory. It should be a directory with mostly just files related to composer. Files such as composer.phar, composer.json, etc. Once there, use your SSH text editor of choice to edit composer.json. For me, it was this

vi composer.json

Per the instructions at Imagine’s github, you need to update your composer.json as follows:

{
  "require": {
    "orchestra/imagine": "2.3.*@dev"
  }
}

In my case, I already had something in my composer.json so it ended up looking like this:

{
  "require": {
    "monolog/monolog": "1.2.*",
    "orchestra/imagine": "2.3.*@dev"
  }
}

Once that is saved, you can update your Laravel installation via this:

php composer.phar update

For further reading, feel free to check out Composer in more detail at https://getcomposer.org/doc/01-basic-usage.md

Explaining the MEAN stack

Let’s check out the web’s latest darling buzzword. The MEAN stack in cynical, sub-layman’s terms. Whoever’s turn it was to be cutesy with the nerd acronyms really nailed it this time.

MongoDB – http://www.mongodb.org/

This is our method of storage. It is the 50’s hip greaser dude to mySQL’s Pauly Shore.

According to http://www.mongodb.org/, it is agile and scalable. If you’re playing hipster developer bingo at home, you’re off to a great start. Also, it has automatic sharding. If this doesn’t make you giggle, then you need to see yourself out.

MongoDB is a key player in the NoSQL movement. That is, not relying fully (or at all) on a database for data queries. Instead using XML, JSON, etc document based solutions. No more querying one table to query another table to query another table. You get delicious data objects that bend to your will at a fraction of the overhead.

ExpressJS – http://expressjs.com/

Bundles up a bunch of NodeJS goodness to be used at our leisure. Perhaps the most expendable letter in the MEAN acronym, this is mostly to make life easier until we want/need to get under the hood of NodeJS.

AngularJS

It’s tagline is Superheroic Javascript MVW Framework. MVW!? What magical, problem solving acronym is MVW? Well it’s Model-View-Whatever. At first glance, this caused a grimace, but upon further research, it is a peaceful gesture to calm the gang mentality of MVC vs MVVM and whatever else ego tripping developers argue over when it comes to frameworks.

What it actually does, is quite impressive. It turns what used to be lifeless HTML into something alive and dynamic.

Nodejs

This allows you to write server side applications via normal javascript. After being a supporting player in all of the web hoopla since animated gifs, it finally gets to be the star.

There you go, you can now bring up this spicy hot buzzword at interviews or company bbqs and ACTUALLY know what it means. If only this existed when I needed to flub my way through the last six months.