I bought a functional project built in Laravel, set it up on my server, and it is working perfectly. There are some features I would like to add but the author isn't interested in doing custom work however he is very supportive when it comes to questions regarding his original work.
So, I searched through the Laravel packages and have found things that sound cool and I would like to try to add them to my existing project. For example: messenger http://packalyst.com/packages/package/cmgmyr/messenger
I see my composer,json file where I can add the lines of code given in the installation instructions but the next step is to run 'composer update'.
I realized I didn't have composer installed. I thought it came with Laravel. I installed composer using the command line and got the message saying composer successfully installed to my root folder. It said also said Use it: php composer.phar.
I cd back to the root directory and tried running composer require cmgmyr/messenger but got the same error message as before stating -bash composer: command not found.
I ran curl -sS https://getcomposer.org/installer | php -- --check and it came back saying all settings correct for composer. But no commands are working.
I ran php composer.phar install and it came back with:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
php artisan clear-complied
php artisan optimized
Generating optimized class loader
Compiling common classes
Commands still not working. Apparently I am overlooking something...
I had tried php composer.phar earlier and it spit out a list of available commands. Nothing else seemed to work except when I ran php composer.phar install. I noticed a pattern.
So I tried php composer.phar require cmgmyr/messenger and it worked!
I have no idea what difference the 'php composer.phar' makes but it makes a world of difference with my setup. Thanks for pointing me in the right direction @mstnorris
Run the following command from where your composer.phar file is located. This will mean you can just run composer from now on.
mv composer.phar /usr/local/bin/composer
Explanation
You need to move the composer.phar into your /usr/local/bin directory. (This is installing it globally). See the Composer documentation. A .phar file is a PHP Archive, and is an executable file, just like any other. When I say you need to move it, you don't actually need to do anything, but by doing so it will save you typing out the full php composer.phar all the time. Also, by moving it to that directory it is available "system-wide".
I hope this clears things up for you. (Also I see you have a subscription, Check out the lesson Meet Composer from the Laravel 5 Fundamentals series.