git clone https://github.com/...
cd laravel-blog
composer install
cp .env.example .env
php artisan key:generate
APP_DEBUG=true #关闭调试
DB_HOST= #数据库地址
DB_PORT=3306 #数据库端口
DB_DATABASE= #数据库名称
DB_USERNAME= #数据库用户
DB_PASSWORD= #数据库密码
php artisan migrate
php artisan db:seed
location / {
root /www/laravel-blog/public;
try_files $uri $uri/ /index.php?$query_string;
index index.php index.html index.htm;
}
chown -R nginx:nginx storage/
chmod -R 755 public/
chown -R nginx:nginx public/
部署到线上可选,本地测试无需执行
php artisan optimize
php artisan config:cache
php artisan route:cache
觉得不错发颗糖吧