The .bashrc
example allows you to run an artisan command from your local terminal inside a Homestead VM.
- SSH to the VM
- Change into the directory where your site lives
- Run an artisan command.
I named my function "artisan" so it overrides the default but you can name it whatever you like. This also assumes you have setup an alias in your ~/.ssh/config
file but that isn't strictly necessary. This will also work simply passing in the username and IP. e.g. ssh [email protected]
Change your path if you are using something other than the default of /home/vagrant/Code
.
Example usage if I want to run a list command inside the site called myapp:
artisan myapp list
Hope this helps someone!