Work log until the top page of the Laravel6 project installed in the VM is displayed with a browser It seems that you can easily do it with Homestead provided by the head family.
https://www.virtualbox.org/wiki/Downloads
https://www.vagrantup.com/downloads.html
This time, Homestead and the shared folder (described later) will be installed in the user's Home.
$ cd ~
$ vagrant box add laravel/homestead
$ git clone https://github.com/laravel/homestead.git ~/Homestead
$ cd ~/Homestead
$ bash init.sh
$ vi Homestead.yaml
The items ʻauthorize and keys` are omitted because they only describe the public and private keys.
Partially rewritten with the following contents
| item | name |
|---|---|
| Mac -Shared folder name between VMs | tukanpo-proj |
| Laravel project name | tukanpo |
| DB name | tukanpo |
folders:
- map: ~/tukanpo-proj
to: /home/vagrant/tukanpo-proj
sites:
- map: tukanpo.test
to: /home/vagrant/tukanpo-proj/tukanpo/public
databases:
- tukanpo
$ mkdir ~/tukanpo-proj
$ chmod 755 ~/tukanpo-proj
$ vagrant up
$ vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64)
Thanks for using
_ _ _
| | | | | |
| |__ ___ _ __ ___ ___ ___| |_ ___ __ _ __| |
| '_ \ / _ \| '_ ` _ \ / _ \/ __| __/ _ \/ _` |/ _` |
| | | | (_) | | | | | | __/\__ \ || __/ (_| | (_| |
|_| |_|\___/|_| |_| |_|\___||___/\__\___|\__,_|\__,_|
* Homestead v10.0.0 released
* Settler v9.1.0 released
0 packages can be updated.
0 updates are security updates.
vagrant@homestead:~$
vagrant@homestead:~$ cd tukanpo-proj
vagrant@homestead:~/tukanpo-proj$ composer create-project --prefer-dist laravel/laravel tukanpo
Add the following to hosts on mac
$ sudo vi /etc/hosts
192.168.10.10 tukanpo.test
http://tukanpo.test
I was addicted to the folders and sites misconfigurations in Homestead.yaml.
Note that if you modify the sites property of Homestead.yaml, it will not be updated unless you execute the following command.
$ vagrant reload --provision
Laravel
vagrant@homestead:~/tukanpo-proj/tukanpo$ php artisan -V
Laravel Framework 6.6.2
```
Homestead
```
$ vi ~/Homestead/bin/homestead
```
This line
```php
$app = new Symfony\Component\Console\Application('Laravel Homestead', '10.0.1');
```
## Save here
Create a remote repository in advance
```
$ cd ~/tukanpo-proj
$ git init
$ git add .
$ git commit
$ git remote add origin [email protected]:tukanpo/tukanpo-proj.git
$ git fetch
$ git merge --allow-unrelated-histories origin/master
```
## reference
https://qiita.com/oreo3@github/items/1705b133e00019800ff6