Skip to content

Commit 6f26f24

Browse files
committed
update laravel v6.2
1 parent 63eb915 commit 6f26f24

File tree

14 files changed

+118
-76
lines changed

14 files changed

+118
-76
lines changed

laravel/app/Http/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Kernel extends HttpKernel
3434
\App\Http\Middleware\TrustProxies::class,
3535

3636
// 跨域访问中间件
37-
// \App\Http\Middleware\Cors::class,
38-
\Barryvdh\Cors\HandleCors::class,
37+
\App\Http\Middleware\Cors::class,
38+
// \Barryvdh\Cors\HandleCors::class,
3939

4040
// 执行时间记录和统计工具
4141
\RunningTime\Middleware\RunningTimeMiddleware::class,

laravel/bootstrap/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
$app = new Illuminate\Foundation\Application(
15-
realpath(__DIR__.'/../')
15+
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
1616
);
1717

1818
/*

laravel/config/app.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
| This value determines the "environment" your application is currently
2424
| running in. This may determine how you prefer to configure various
25-
| services your application utilizes. Set this in your ".env" file.
25+
| services the application utilizes. Set this in your ".env" file.
2626
|
2727
*/
2828

@@ -39,7 +39,7 @@
3939
|
4040
*/
4141

42-
'debug' => env('APP_DEBUG', false),
42+
'debug' => (bool) env('APP_DEBUG', false),
4343

4444
/*
4545
|--------------------------------------------------------------------------
@@ -54,6 +54,8 @@
5454

5555
'url' => env('APP_URL', 'http://localhost'),
5656

57+
'asset_url' => env('ASSET_URL', null),
58+
5759
/*
5860
|--------------------------------------------------------------------------
5961
| Application Timezone
@@ -121,23 +123,6 @@
121123

122124
'cipher' => 'AES-256-CBC',
123125

124-
/*
125-
|--------------------------------------------------------------------------
126-
| Logging Configuration
127-
|--------------------------------------------------------------------------
128-
|
129-
| Here you may configure the log settings for your application. Out of
130-
| the box, Laravel uses the Monolog PHP logging library. This gives
131-
| you a variety of powerful log handlers / formatters to utilize.
132-
|
133-
| Available Settings: "single", "daily", "syslog", "errorlog"
134-
|
135-
*/
136-
137-
'log' => env('APP_LOG', 'single'),
138-
139-
'log_level' => env('APP_LOG_LEVEL', 'debug'),
140-
141126
/*
142127
|--------------------------------------------------------------------------
143128
| Autoloaded Service Providers
@@ -215,6 +200,7 @@
215200
'aliases' => [
216201

217202
'App' => Illuminate\Support\Facades\App::class,
203+
'Arr' => Illuminate\Support\Arr::class,
218204
'Artisan' => Illuminate\Support\Facades\Artisan::class,
219205
'Auth' => Illuminate\Support\Facades\Auth::class,
220206
'Blade' => Illuminate\Support\Facades\Blade::class,
@@ -244,6 +230,7 @@
244230
'Schema' => Illuminate\Support\Facades\Schema::class,
245231
'Session' => Illuminate\Support\Facades\Session::class,
246232
'Storage' => Illuminate\Support\Facades\Storage::class,
233+
'Str' => Illuminate\Support\Str::class,
247234
'URL' => Illuminate\Support\Facades\URL::class,
248235
'Validator' => Illuminate\Support\Facades\Validator::class,
249236
'View' => Illuminate\Support\Facades\View::class,

laravel/config/auth.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'api' => [
4545
'driver' => 'jwt',
4646
'provider' => 'users',
47+
'hash' => false,
4748
],
4849
],
4950

@@ -96,7 +97,21 @@
9697
'provider' => 'users',
9798
'table' => 'password_resets',
9899
'expire' => 60,
100+
'throttle' => 60,
99101
],
100102
],
101103

104+
/*
105+
|--------------------------------------------------------------------------
106+
| Password Confirmation Timeout
107+
|--------------------------------------------------------------------------
108+
|
109+
| Here you may define the amount of seconds before a password confirmation
110+
| times out and the user is prompted to re-enter their password via the
111+
| confirmation screen. By default, the timeout lasts for three hours.
112+
|
113+
*/
114+
115+
'password_timeout' => 10800,
116+
102117
];

laravel/config/broadcasting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'app_id' => env('PUSHER_APP_ID'),
3838
'options' => [
3939
'cluster' => env('PUSHER_APP_CLUSTER'),
40-
'encrypted' => true,
40+
'useTLS' => true,
4141
],
4242
],
4343

laravel/config/cache.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
| using this caching library. This connection is used when another is
1414
| not explicitly specified when executing a given caching function.
1515
|
16-
| Supported: "apc", "array", "database", "file", "memcached", "redis"
16+
| Supported: "apc", "array", "database", "file",
17+
| "memcached", "redis", "dynamodb"
1718
|
1819
*/
1920

@@ -59,7 +60,7 @@
5960
env('MEMCACHED_PASSWORD'),
6061
],
6162
'options' => [
62-
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
63+
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
6364
],
6465
'servers' => [
6566
[
@@ -75,6 +76,15 @@
7576
'connection' => 'cache',
7677
],
7778

79+
'dynamodb' => [
80+
'driver' => 'dynamodb',
81+
'key' => env('AWS_ACCESS_KEY_ID'),
82+
'secret' => env('AWS_SECRET_ACCESS_KEY'),
83+
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
84+
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
85+
'endpoint' => env('DYNAMODB_ENDPOINT'),
86+
],
87+
7888
],
7989

8090
/*

laravel/config/database.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use Illuminate\Support\Str;
4+
35
return [
46

57
/*
@@ -35,12 +37,15 @@
3537

3638
'sqlite' => [
3739
'driver' => 'sqlite',
40+
'url' => env('DATABASE_URL'),
3841
'database' => env('DB_DATABASE', database_path('database.sqlite')),
3942
'prefix' => '',
43+
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
4044
],
4145

4246
'mysql' => [
4347
'driver' => 'mysql',
48+
'url' => env('DATABASE_URL'),
4449
'host' => env('DB_HOST', '127.0.0.1'),
4550
'port' => env('DB_PORT', '3306'),
4651
'database' => env('DB_DATABASE', 'forge'),
@@ -61,6 +66,7 @@
6166

6267
'pgsql' => [
6368
'driver' => 'pgsql',
69+
'url' => env('DATABASE_URL'),
6470
'host' => env('DB_HOST', '127.0.0.1'),
6571
'port' => env('DB_PORT', '5432'),
6672
'database' => env('DB_DATABASE', 'forge'),
@@ -75,6 +81,7 @@
7581

7682
'sqlsrv' => [
7783
'driver' => 'sqlsrv',
84+
'url' => env('DATABASE_URL'),
7885
'host' => env('DB_HOST', 'localhost'),
7986
'port' => env('DB_PORT', '1433'),
8087
'database' => env('DB_DATABASE', 'forge'),
@@ -106,28 +113,37 @@
106113
|--------------------------------------------------------------------------
107114
|
108115
| Redis is an open source, fast, and advanced key-value store that also
109-
| provides a richer set of commands than a typical key-value systems
116+
| provides a richer body of commands than a typical key-value system
110117
| such as APC or Memcached. Laravel makes it easy to dig right in.
111118
|
112119
*/
113120

114121
'redis' => [
115122

116-
'client' => 'predis',
123+
'client' => env('REDIS_CLIENT', 'phpredis'),
124+
125+
'options' => [
126+
'persistent' => true, // 开启持久连接
127+
'cluster' => env('REDIS_CLUSTER', 'redis'),
128+
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
129+
],
117130

118131
'default' => [
132+
'url' => env('REDIS_URL'),
119133
'host' => env('REDIS_HOST', '127.0.0.1'),
120134
'password' => env('REDIS_PASSWORD', null),
135+
'port' => env('REDIS_PORT', '6379'),
136+
'database' => env('REDIS_DB', '0'),
121137
'port' => env('REDIS_PORT', 6379),
122138
'database' => env('REDIS_DB', 0),
123-
'persistent' => true, // 开启持久连接
124139
],
125140

126141
'cache' => [
142+
'url' => env('REDIS_URL'),
127143
'host' => env('REDIS_HOST', '127.0.0.1'),
128144
'password' => env('REDIS_PASSWORD', null),
129-
'port' => env('REDIS_PORT', 6379),
130-
'database' => env('REDIS_CACHE_DB', 1),
145+
'port' => env('REDIS_PORT', '6379'),
146+
'database' => env('REDIS_CACHE_DB', '1'),
131147
],
132148

133149
],

laravel/config/filesystems.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
| may even configure multiple disks of the same driver. Defaults have
3838
| been setup for each driver as an example of the required options.
3939
|
40-
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
40+
| Supported Drivers: "local", "ftp", "sftp", "s3"
4141
|
4242
*/
4343

@@ -55,22 +55,14 @@
5555
'visibility' => 'public',
5656
],
5757

58-
// 新建 uploads 目录存储上传的文件
59-
'uploads' => [
60-
'driver' => 'local',
61-
// 文件将上传到 storage/app/uploads 目录
62-
'root' => storage_path('app/uploads'),
63-
// 文件将上传到 public/uploads 目录 如果需要浏览器直接访问 请设置成这个
64-
// 'root' => public_path('uploads'),
65-
],
66-
6758
's3' => [
6859
'driver' => 's3',
6960
'key' => env('AWS_ACCESS_KEY_ID'),
7061
'secret' => env('AWS_SECRET_ACCESS_KEY'),
7162
'region' => env('AWS_DEFAULT_REGION'),
7263
'bucket' => env('AWS_BUCKET'),
7364
'url' => env('AWS_URL'),
65+
'endpoint' => env('AWS_ENDPOINT'),
7466
],
7567

7668
],

laravel/config/logging.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Monolog\Handler\NullHandler;
34
use Monolog\Handler\StreamHandler;
45
use Monolog\Handler\SyslogUdpHandler;
56

@@ -36,7 +37,8 @@
3637
'channels' => [
3738
'stack' => [
3839
'driver' => 'stack',
39-
'channels' => ['daily'],
40+
'channels' => ['single'],
41+
'ignore_exceptions' => false,
4042
],
4143

4244
'single' => [
@@ -61,7 +63,7 @@
6163
],
6264

6365
'papertrail' => [
64-
'driver' => 'monolog',
66+
'driver' => 'monolog',
6567
'level' => 'debug',
6668
'handler' => SyslogUdpHandler::class,
6769
'handler_with' => [
@@ -73,6 +75,7 @@
7375
'stderr' => [
7476
'driver' => 'monolog',
7577
'handler' => StreamHandler::class,
78+
'formatter' => env('LOG_STDERR_FORMATTER'),
7679
'with' => [
7780
'stream' => 'php://stderr',
7881
],
@@ -87,6 +90,15 @@
8790
'driver' => 'errorlog',
8891
'level' => 'debug',
8992
],
93+
94+
'null' => [
95+
'driver' => 'monolog',
96+
'handler' => NullHandler::class,
97+
],
98+
99+
'emergency' => [
100+
'path' => storage_path('logs/laravel.log'),
101+
],
90102
],
91103

92104
];

laravel/config/mail.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
| sending of e-mail. You may specify which one you're using throughout
1212
| your application here. By default, Laravel is setup for SMTP mail.
1313
|
14-
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
15-
| "sparkpost", "log", "array"
14+
| Supported: "smtp", "sendmail", "mailgun", "ses",
15+
| "postmark", "log", "array"
1616
|
1717
*/
1818

@@ -120,4 +120,17 @@
120120
],
121121
],
122122

123+
/*
124+
|--------------------------------------------------------------------------
125+
| Log Channel
126+
|--------------------------------------------------------------------------
127+
|
128+
| If you are using the "log" driver, you may specify the logging channel
129+
| if you prefer to keep mail messages separate from other log entries
130+
| for simpler reading. Otherwise, the default channel will be used.
131+
|
132+
*/
133+
134+
'log_channel' => env('MAIL_LOG_CHANNEL'),
135+
123136
];

0 commit comments

Comments
 (0)