Laravel Homestead alias

May 08, 2019
1 min read

This content is over a year old

When reading, please keep its age in mind as the information presented may be out of date with current developments, practices or personal viewpoints.

The following alias will make interacting with Homestead a lot easier.

# Homestead
alias homestead='function __homestead() {
    if [[ $@ == "config" ]]; then
        command open ~/Homestead/Homestead.yaml
    elif [[ $@ == "aliases" ]]; then
        command open ~/Homestead/aliases
        (cd ~/Homestead && vagrant $*);
}; __homestead'
  • homestead config will open your Homestead configuration file
  • homestead aliases will open your Homestead alias file
  • homestead ... referencing any vagrant command off of homestead will forward the command accordingly. (e.g. homestead ssh to SSH into your Homestead machine)