Update hosts file for Laravel Homestead via Terminal

While playing around with Homestead, Laravel’s pre-packaged Vagrant virtual machine, the documentation suggests that when you edit Homestead.yaml and re-provision the vm,  you should manually edit the /etc/hosts file. I found that it doesn’t take advantage of the Vagrant Hostsupdater plugin. To (micro-)optimize my workflow, I’ve added a function to my .bash_profile:

Now I can type hup craigfreeman from the command line to append craigfreeman.local to my hosts file every time I add a new site to my vm.

Leave a Reply

Your email address will not be published. Required fields are marked *