SarangaR
SarangaR

Reputation: 764

Existing project run with Laravel homestead (5.4)

I have installed Laravel homestead it's working fine. my problem is how I map existing project to homestead? my Homestead.yaml file as bellow

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:

    - map: D:/www/Laravel
      to: /home/vagrant/Code/Laravel  


sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public



databases:
    - homestead 

This project generated from Homestead I have another exist project and how to map homestead.I added following code to Homestead.yaml file but it was not working.

 - map: D:/www/MyProject
      to: /home/vagrant/Code/MyProject 

Please anyone can help me Thank you.

Upvotes: 0

Views: 2004

Answers (2)

Parth Vora
Parth Vora

Reputation: 4114

Try this:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:

    - map: D:/www/
      to: /home/vagrant/Code/


sites:
    - map: MyProject.app
      to: /home/vagrant/Code/MyProject/public


databases:
    - homestead 

Make sure that:

1) There is a code folder inside C:/users/{currentuser}/

2) You have MyProject folder in D:/www

3) A virtual hosts file entry: Vagrant box IP MyProject.app

And at last fire vagrant reload --provision command within C:/users/{currentuser}/Homestead folder

Upvotes: 1

Almazik G
Almazik G

Reputation: 1077

you should edit your folders section to map to you www directory

folders:

    - map: D:/www
      to: /home/vagrant/Code

this will allow you to store all of your projects within D:/www directory and all of them will be mapped to your VM.

now you can add your Site

you should add this under Sites

 - map: my-project.app
   to: /home/vagrant/Code/MyProject/public

this assumes that your project is located at D:/www/MyProject


also don't forget to add new domain to your hosts file

192.168.10.10    my-project.app

and run vagrant reload --provision

Upvotes: 4

Related Questions