dotibrb048760 2015-06-22 13:22
浏览 86
已采纳

正确使用Laravel Homestead

I have done few projects with laravel. I also tried to use the good practise such us using only models for all calls and use artisian commands.

In my next project i plan to use still more such as using Homestead.

I read more about Laravel Homestead which actually needs Vagrantup.

But i don't know the actual need of Homestead and how to install it.

enter image description here

Any help would be helpful for me and future readers.

  • 写回答

1条回答 默认 最新

  • duanjin9035 2015-06-22 16:04
    关注

    I assume you already install VirtualBox or VMWare. After downloading Homestead from Git, you need to amend Homestead.yaml file

    ip: "192.168.10.10"
    memory: 2048
    cpus: 1
    
    authorize: /Users/Documents/workspace/myssh.pub #pub path 
    
    keys:
        - /Users/Documents/workspace/myssh   #ssh key
    
    folders:
        - map: /Users/Documents/workspace/dev/myProject #My project directory
           to: /home/vagrant/code/myProject  #Vagrant project directory, no need to change this /home/vagrant/code/
    sites:
        - map: yourproject.app   #you can change whatever you prefer
           to: /home/vagrant/code/myProject/public #no need to change this /home/vagrant/code/
    
    variables:
        - key: APP_ENV
          value: local
    

    Then, we remain one final step to amend. Open hosts file under /etc/. I will use VI to amend this. You can use whatever you like.

    vi /etc/hosts
    

    enter image description here

    You need to add new line in this file

    192.168.10.10   yourproject.app  //same with code line 11
    

    Finally, you just only need to run vagrant up. Please don't forgot one thing. If you shutdown your PC without shutdown your vagrant, it's take too long to shutdown your PC. Even your PC is shutdown, vagrant might be crushed when you run again vagrant up. Before your shutdown your PC, you need to run vagrant halt for safe.

    Hope this help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化