Reputation: 7650
Inside my homestead virtual machine, I ran laravel new test
. Now I got a fresh laravel project in my homestead virtual machine.
Then I configured the Homestead.yaml
:
- map: ~/work/test # an empty dirctory
to: /home/vagrant/test
Finally, I ran vagrant reload --provision
.
Oops, I found home/vagrant/test
is an empty directory now!
It seems vagrant only sync data from Host Machine to Homestead Virtual Machine, and I just want to create a project inside a Homestead Virtual Machine, then sync it to Homestead Virtual Machine.
Is there any way I can achieve that?
Upvotes: 4
Views: 894
Reputation: 15941
/home/vagrant/test
is directory which is in your machine and not on your VM
if you want to create project then create in this directory run the following command
composer create-project --prefer-dist laravel/laravel ./
This command will create the project in your current directory after this run
vagrant reload --provision
after provision run
vagrant ssh
cd ~/work/test
ls
now you can see your all the files of newly created project.
Upvotes: 1