0
votes

I just followed the manual at the laravel website and installed homestead. When running vagrant up it runs fine and I can connect using vagrant ssh. There is only one step I can not find, how do i start a new laravel project using the vagrant installation. I can ssh to the vargant machine so I assume I should run laravel new someproject somewhere on the vagrant environment?

In my Homestead.yaml I have:

folders:
    -   map: D:/Documents/repos/someproject
        to: /home/vagrant/someproject

sites:
    -   map: someproject.test
        to: /home/vagrant/someproject/public

Where someproject is currently empty as i want to start a new project and not work on an existing one. I do not have composer/php/mysql on my windows machine but I assume the benefit of the vargant box is that it has all the needed dependencies and I should run it in vagrant. I tried running it in /home/vagrant but i got:

laravel new someproject

In NewCommand.php line 110:

Application already exists!

new [--dev] [--auth] [-f|--force] [--] []

' So how do I start the new laravel project after installing vagrant?

1

1 Answers

1
votes

The message says that the application someproject already exists. Does the folder already exists in /home/vagrant?

Make sure to add the domain to your hosts file. For Ubuntu, this would be in/etc/ folder. If you want to access your website through someproject.test add

192.188.10.10 someproject.test

to your hosts file.

The site link has to be mention in you Homestead.yaml

sites:
    -   map: someproject.test
        to: /home/vagrant/somneproject/public

Make sure to call

vagrant reload --provision

after saving the changes.

Now if you type someproject.test into the browser you should see the default page (assuming you have generate the key for your laravel application, otherwise you may get an error).