Djave
Djave

Reputation: 9339

Laravel working but files missing in mapped directory from homestead

I have just made the following Homestead.yaml file:

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/GIT/old-project
      to: /home/vagrant/old-project
    - map: ~/GIT/project
      to: /home/vagrant/project

sites:
    - map: old-project.app
      to: /home/vagrant/old-project/public
    - map: project.app
      to: /home/vagrant/project/public

databases:
    - name: old-project
    - name: project

variables:
    - key: APP_ENV
      value: local

old-project already existed. Next I ran vagrant up, then vagrant ssh then inside the vagrant box I ran composer create-project laravel/laravel project 4.2 --prefer-dist. Laravel installed. I edited my /etc/hosts file and now project.app leads me to the Laravel 'You have arrived' page. Great – everything works.

But on my mac, the folder ~/GIT/project is empty.

What part of the installation process did I miss? Is there anything I've done wrong that has prevented the files from mapping across correctly?

If I open ~/GIT/old-project all the Laravel files are there, and it works as I'd expect. I can't remember any difference in how I set up that project.

Upvotes: 0

Views: 889

Answers (1)

pespantelis
pespantelis

Reputation: 15372

I guess you should run the vagrant provision command, to make the added directory (~/GIT/project) shared with the homestead.

When you run the command vagrant up for the first time, the directory ~/GIT/old-project became shared with the homestead. However the directory ~/GIT/project is not shared therefore it is empty on your mac.

Note: When running the provision command, your existing databases will be destroyed and recreated.

Upvotes: 1

Related Questions