Creating a new laravel with homestead is very easy and convenient. Follow along to create a new application project using homestead's terminal commands to add new websites in your virtualbox virtual machine. In our example, we already have homestead.test running fine but what if we want to add another application, lets call it myApp. Follow these instructions:
Note: > means its a DOS command in windows
To stop vagrant if you are already running, run this command:> vagrant halt
Open the Homestead.yaml with your favorite editor and make it look like this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
# YOU CAN SKIP THESE TWO OPTIONS FOR TESTDEV:
#authorize: ~/.ssh/id_rsa.pub
#keys:
# - ~/.ssh/id_rsa
folders:
- map: F:\Path\To\LARAVEL\Projects
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/example/public
- map: myApp.test
to: /home/vagrant/code/myApp/public
databases:
- homestead
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
Be sure to save your changes.
open hosts file as administrator. You can find the hosts files in windows in the following folder: C:\Windows\System32\drivers\etc\
Add the myApp into your list. The hosts file should look like this at the bottom of the file:
192.168.10.10 homestead.test
192.168.10.10 myApp.test
To restart your vagrant use the --provisioning flag to take the new changes. The virtualbox server will serve both websites. Run the following command:> vagrant up --provision
Now you can open both different websites or projects from one single virtualbox.
http://homestead.test
http://myapp.test
https://laracasts.com/discuss/channels/requests/create-multiple-sites-on-homestead-20