Laravel local development environment with helper scripts.
Official documentation is located here.
- Provides helper scripts for booting, destroying and editing the homestead environment.
- Sets up firewall rules to forward port 8000 to 80.
- Automatically adds virtual hosts from Homestead.yaml to /etc/hosts.
- Flushes firewall rules on destroy.
- Removes virtual hosts on destroy.
- Resets virtual hosts and provisions the virtual machine on configuration edit.
- Added homestead configuration (Homestead-sample.yaml) as a template.
- Homestead configuration file is now excluded from Git.
- MySQL ports are set to default (3306, 5432).
Make sure you have vagrant and virtualbox installed. Navigate to the path you want the homestead to be installed. Install as follows:
git clone https://github.com/miagg/homestead.git
cd Homestead
cp Homestead-sample.yaml Homestead.yaml
vagrant box add laravel/Homestead
Add the following aliases to your ~\.bash_profile
or ~\.bash_aliases
alias vm='ssh [email protected] -p 2200'
alias vmup="pushd ~/Homestead >/dev/null && bash vmup.sh && popd >/dev/null"
alias vmdown="pushd ~/Homestead >/dev/null && bash vmdown.sh && popd >/dev/null"
alias vmedit="pushd ~/Homestead >/dev/null && bash vmedit.sh && popd >/dev/null"
Change ~/Homestead
to your installation path.
Use vmedit
to set your shared folders and sites. See original documentation here.
SSH into the virtual machine
- Sets firewall rules to forward port 8000 to 80.
- Adds virtual hosts to /etc/hosts.
- Boots up homestead.
- Flushes firewall rules.
- Removes virtual hosts from /etc/hosts.
- Destroys the homestead.
- Opens up Homestead.yaml (configuration file) with the predefined editor (default: sublime).
- If any changes are detected it resets virtual hosts to /etc/hosts and provisions the machine.
To change the editor: edit vmedit.sh and set your editor in line 4. Example: EDITOR='nano'