Installing Composer

There are two ways to download and install Laravel. One is to download an installer program which when you run it will create a new Laravel project simply and quickly, in the current folder, whenever you want to. The other way is to use. Composer is currently the most popular PHP dependency package management system. When I first attempted to use the Laravel installer on Windows I found there was a bit more work required on Windows then there would have been on Linux. Also there seemed to be some inconsistencies in the way it worked. The composer method on the other hand worked well straight off the bat. Given the importance of Composer to the world of PHP it was going to be necessary to use it at some stage so we may as well use it right from the start. Its worth mentioning, at this point, that you must have PHP installed to install Laravel using either method so if you have not already installed PHP go ahead and do so now. If you haven't done this before it's very straightforward and just takes a few minutes - there are many popular guides.

Dependency Package Management Systems

Modern software systems tend to be an assemblage of interdependent components. This is great but complex. Component A won't work unless component B is loaded as it has it uses B's components. Component B work work unless C is loaded. Add the different versions of the various components into this mix and managing the interdependencies becomes a nightmare. This is where package/dependency management comes in. Every language has it's preferred (or couple of preferred) package management systems. Java has Maven, Javascript has npm and bower and PHP has Composer and PEAR. PEAR has fallen away somewhat and Composer is currently the most popular. Once you get comfortable with them, package managers are great. They massively simplify a very complex problem. The only downside is that when you're getting started they add an extra layer of complexity which can be a little bit daunting if your new to it.

Laravel is effectively a set of components assembled into a framework. With this in mind Composer allows us to install the various components created by disparate vendors on which Laravel depends. Before we can do this we need to install Composer itself. To download composer visit - copy each of the lines from the command line installation steps into the CLI in your project folder as follows:

Leave a Reply