
Add Your Own Aliases to Laravel Homestead
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:
export $PATH="./vendor/bin:$PATH"
Also, last week we shared some great Laravel community bash aliases that you might consider adding to Homestead!
Filed in: Laravel Tutorials / Homestead
Enjoy this? Get Laravel News delivered straight to your inbox every Sunday.
No Spam, ever. We'll never share your email address and you can opt out at any time.
Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.
Laravel Jobs

- PHP Web Developer
-
Orlando, FL
Christ for all Nations - PHP Developer
-
Manhattan, KS (open to Remote)
CivicPlus - Mid-Senior Laravel Developer
-
Exeter
Optix Solutions - Full Stack Web Developer
-
Las Vegas, NV
V Shred - Staff Software Engineer (Laravel)
-
Remote
smartbnb - Software Engineer (PHP, Laravel, Vue)
-
Los Angeles, CA
Relocity - Software Engineer Level 1 / Level 2
-
St. Pete. / Tampa Area, FL / Remote
ShineOn
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…