LoginSignup
0
0

More than 3 years have passed since last update.

Laravel Homesteadに複数のプロジェクトを構築する方法

Last updated at Posted at 2020-09-11

参考記事
https://www.hypertextcandy.com/multiple-projects-in-laravel-homestead

Homestead.ymlファイルを2箇所修正

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

viでhostsを編集

sudo vi /etc/hosts
192.168.10.10  homestead.test second.test

.env

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=second
DB_USERNAME=homestead
DB_PASSWORD=secret

vagrant再起動

# vagrant を抜ける
$ exit

# ローカルに戻ったら、vagrantをストップ
$ vagrant halt

# vagrant 再起動
$ vagrant up --provision

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0