I’ve been working with Laravel for a couple of months and have seen Artisan pop up here and there while viewing various docs. I was aware that Artisan is a command line interface for Laravel but had never, until today, come across a situation where I’d have to use it.
I needed to install the feeder bundle to a site I was working on. I could have just downloaded the bundle from GitHub and installed in manually but thought this was an opportune time to get my hands wet with Artisan. I struggled to find any complete beginner docs on how to actually get into Artisan. It turned out to be offensively simple so after a few minutes I’d worked it out:
SSH into your server and navigate to your site’s root directory (via terminal or an SSH client like putty) containing the ‘artisan’ file …
ssh [email protected] cd /path/to/site
…from there you can access Artisan.
To see a list of available Artisan commands and to check you are in the right place, enter
php artisan help:commands
This will list off the available commands
Now to install your bundle, you need to use the install command, specifying the bundle you wish to install.
php artisan bundle:install bundlename
This will install the bundle and if successful you will get a message like so:
Fetching [bundlename]...done! Bundle installed.