Home>

Tutorial/Laravel Homestead on Mac Setup
[Introduction to Laravel] Construction of development environment (VirtualBox + Vagrant + Homestead + Composer)

I am building a Laravel environment with Homestead referring to the above article, but it does not work.
After logging in to the virtual machine (vagrant @ homestead), the directory code should be displayed, but even if you do ls, nothing is displayed and you cannot proceed.
( [Super introduction to Laravel] Construction of development environment (VirtualBox + Vagrant + Homestead + Composer) stumbled in step 8)

I'd appreciate someone's solution or advice.

Additional current Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    -~/.ssh/id_rsa
folders:
    -map: ~/MyCentOS3
      to:/home/vagrant/code
sites:
    -map: homestead.app
      to:/home/vagrant/code/Laravel/public
databases:
    -homestead

 ports:
#-send: 50000
# to: 5000
#-send: 7777
# to: 777
# protocol: udp
# blackfire:
#-id: foo
# token: bar
# client-id: foo
# client-token: bar
# zray:
# If you've already freely registered Z-Ray, you can place the token here.
#-email: [email protected]
# token: foo
# Don't forget to ensure that you have 'zray: "true"' for your site.
  • Answer # 1

    First of all, please refer to the official document or the translated document below, not the old or inaccurate Qiita or blog articles.

    https://readouble.com/laravel/5.6/en/homestead.html


      The directory

    code should be displayed, but even if you do ls, nothing is displayed and you cannot proceed.

    This is probably due to a missing~/MyCentOS3.
    Please make it on MacOS.

    mkdir ~/MyCentOS3

    Next isHomestead.yml

    sites:
        -map: homestead.app // ← ☓
          to:/home/vagrant/code/Laravel/public // ← ☓

    homestead.app → The existing top domain cannot be used in the local development environment (SSL is required)

    /home/vagrant/code/Laravel/public → Incorrect directory specification

    The point of ↑ is wrong.
    So first of all, let's look at the official document.

    .appwas recently added.
    https://japan.cnet.com/article/35118647/

    So fix it as below.

    sites:
        -map: homestead.test
          to:/home/vagrant/code/public

    To reflect changes inHomestead.yml

    vagrant reload --provision
    Run

    to restart.
    Don't forget-provision.

    If there is no source under the virtual machine'scodedirectory after reboot,

    laravel new/home/vagrant/code
    Run

    inside the virtual machine to generate the Laravel project.