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:
vagrant 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:
alias ..="cd .." alias ...="cd ../.." alias h='cd ~' alias c='clear' alias art=artisan alias phpspec='vendor/bin/phpspec' alias phpunit='vendor/bin/phpunit' alias serve=serve-laravel alias xoff='sudo phpdismod -s cli xdebug' alias 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!
Join the weekly newsletter and never miss out on new tips, tutorials, and more.
- PHP Web Developer
Christ for all Nations
- PHP Developer
Manhattan, KS (open to Remote)
- Mid-Senior Laravel Developer
- Full Stack Web Developer
Las Vegas, NV
- Staff Software Engineer (Laravel)
- Software Engineer (PHP, Laravel, Vue)
Los Angeles, CA
- Software Engineer Level 1 / Level 2
St. Pete. / Tampa Area, FL / Remote
Laravel 5.5 LTS is Now Released
Version 5.5 of Laravel is now officially released! This release is jam-packed with goodies and improvements–here̵…
All of the Laracon US 2017 Videos are now available
StreamACon released twenty-one videos from Laracon US so you’ll be able to relive the whole event and catch up…