laravel 项目常用指令

Create vhost

1
2
cd ~/oneinstack
./vhost.sh

Git clone

1
git clone <url> .

Create & Edit .env

1
2
3
cd <project dir>
mv .env.example .env
vim .env

Then,edit it

Finally,create a app_key

1
php artisan key:generate

Change file permission

1
2
3
4
5
6
chmod -R 777 <project dir>
chown -R www-data:www-data <project dir>

cd <project dir>
chgrp -R www storage bootstrap/cache
chmod -R ug+rwx storage bootstrap/cache

Migration(For Dcat-Admin)

1
php artisan migrate:refresh && php artisan admin:install && php artisan db:seed

vagrant

1
2
3
4
5
6
vagrant init	  初始化 vagrant
vagrant up 启动 vagrant
vagrant halt 关闭 vagrant
vagrant ssh 通过 SSH 登录 vagrant(需要先启动 vagrant)
vagrant provision 重新应用更改 vagrant 配置
vagrant destroy 删除 vagrant