Laravel Homestead ships with some aliases that get copied into your Homestead virtual machine when you provision it. These aliases are available inside the virtual machine, and you can also add your aliases as well so that you have the same aliases in Homestead that you might use on your local setup. I’ll quickly show you how you can add your aliases.
After you install Homestead and run
bash init.sh, the init script copies the aliases file to
~/Homestead/aliases on OS X.
When you make changes to the aliases file, you need to reprovision the image:
1vagrant reload --provision
If you look at the Vagrantfile, you can see how the aliases file gets copied into the Homestead machine. By default, Homestead has some helpful aliases already defined that you can use right away:
1alias ..="cd .."2alias ...="cd ../.."34alias h='cd ~'5alias c='clear'6alias art=artisan78alias phpspec='vendor/bin/phpspec'9alias phpunit='vendor/bin/phpunit'10alias serve=serve-laravel1112alias xoff='sudo phpdismod -s cli xdebug'13alias xon='sudo phpenmod -s cli xdebug'
For example, you can run “h” to go to the home folder, or run “phpunit” without referencing the full vendor/bin path. Another way I like to achieve something similar is adding
vendor/bin to my path:
Also, last week we shared some great Laravel community bash aliases that you might consider adding to Homestead!