I have been using XAMPP for quite a time, and after discovering Laravel and finding out, that I quite like it, I also wanted to use Homestead. The problem I\'m having is, th
There are some important steps missing in the accepted answer although it helped me lot. I have added those necessary steps. Thanks @Hieu Le for answer.
I assume you have correctly installed your fist site as by the instructions of Laravel docs. Now you have another laravel site which you want to shift on vagrant. Follow the following steps.
cd
into the directory of new Laravel project which you want to add. I assume you have all laravel files in it and its working using MAMP
or any non-vagrant solution.vagrant init laravel/homestead
. This command will add the necessary VagrantFile
in this new project.Homestead.yaml
file in editor.Now follow the steps defined by @Hieu Le in accepted answer to
modify .yaml
file
folders: - map: ~/pj1 to: /path/to/project1 - map: ~/pj2 to: /path/to/project2 sites: - map: project1.local to: /home/vagrant/pj1/public - map: project2.local to: /home/vagrant/pj2/public
Edit your hosts file to forward these domain fo localhost
127.0.0.1 project1.local 127.0.0.1 project2.local
cd
into your first original original project
directory.vagrant reload --provision
. This will reload the
vagrant machine so that the changes which we made in .yaml
file come in effect. You database of original project will remain intact.vagrant ssh
ls
and make sure you can see the folder of your new project. If its there
you have configured your new site correctly.http://
and your are
DONE.