Laravel Homestead is used as the local development environment.
- Install PHP and Composer
- Install Virtualbox (6.0+), Vagrant (2.2.7+), and vagrant-hostsupdater
- Execute
composer run localandvagrant up
The Hostsupdater plugin for Vagrant is recommended to avoid having to manually manage your hosts file.
vagrant plugin install vagrant-hostsupdater
To also avoid having to type your password every time you vagrant up, see
the plugin docs linked above for instructions on adding a sudoers file.
Alternatively, you can manually edit your system's hosts file to map each
site listed in Homestead.yaml to the IP address also specified there.
.env, Homestead.yaml, Vagrantfile are generated automatically and
are ignored by git, so you can safely make changes specific to your local
environment in those files. You can also create user-customizations.sh
to add additional provision commands which will run following after.sh.
.env.example and Homestead.yaml.example are copied by composer run local.
- Each domain in
Homestead.yamlshould be accessible via browser when vagrant is running. - Mailhog can be accessed via a domain or localhost on port
8025.
Notes:
.env.example,.gitignore, andcomposer.jsonare just snippets of those files directly relevant to this example setup.after.shprovides an easy place to install any system dependencies or do some extra setup like auto-restoring database backups..envhere is targeted at Laravel projects. Other projects may need to pass this information into the app differently.composer localscript is a good place to add commands likeide-helper:generateandide-helper:meta.