Laravel开工准备

#0 创建项目

composer create-project laravel/laravel test --prefer-dist "5.8.*"

.env 文件中配置APP_NAME、APP_URL、DB_DATABASES

#1 安装ide-helper

https://www.jianshu.com/p/62d0eb53c3f9

#2 语言包、时区

composer require overtrue/laravel-lang

替换config/app.php:
Illuminate\Translation\TranslationServiceProvider::class,
替换为:
Overtrue\LaravelLang\TranslationServiceProvider::class,

php artisan lang:publish zh-CN

config/app.php:

-    'locale' => 'en',
+    'locale' => 'zh-CN',

-    'timezone' => 'UTC',
+    'timezone' => 'Asia/Shanghai',

#3 执行命令

php artisan key:generate
php artisan storage:link

#6 忽略下列文件或文件夹

.gitignore:

.phpstorm.meta.php
_ide_helper.php
.idea

#7 修改日志文件权限

config/logging.php

...
'daily' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel.log'),
    'level' => 'debug',
    'days' => 14,
    'permission' => 0666 // <= 添加这句话
],
...

你可能感兴趣的:(Laravel开工准备)