You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone -b php-7 https://github.com/laravel/homestead.git Homestead7
# if you already have ~/.homestead no need to run bash init.sh
bash init.sh
# add this line on top of ~/.homestead/Homestead.yaml file
box: laravel/homestead-7
# then run vagrant up
Config
# config file stay in ~/.homestead/Homestead.yaml
# set provider
provider: virtualbox
# generate SSH key
ssh-keygen -t rsa -C "you@homestead"
# sync folder
# map
# to [Virtual]
folders:
- map: ~/Code
to: /home/vagrant/Code
# config nginx site
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
set hosts file
vim /etc/hosts
# set 192.168.10.10 homestead.app
# can access http://homestead.app
Launch Project
cd Homestead
vagrant up
Destory Vagrant
vagrant destroy --force
Create Laravel project
vagrant ssh
cd Code
laravel new {project}
Per Project Homestead
cd {project}
composer require laravel/homestead --dev
php vendor/bin/homestead make
vagrant up
# add this line on top of Homestead.yaml in project folder (under ---)
box: laravel/homestead-7
Mysql
cd {project}
vagrant ssh
mysql -uroot -p
# username homestead password secret
Start Dev
mysql -uroot -p
mysql > CREATE DATABASE {name};
php artisan key:generate (see .env)