Skip to content

Commit b706d72

Browse files
committed
Upgrade laravel and laravel-mix
1 parent 98f3e00 commit b706d72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1527
-521
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": ["es2015", "stage-2"]
2+
"presets": [["@babel/preset-env", { "modules": false }]],
3+
"plugins": ["@babel/plugin-syntax-dynamic-import"]
34
}

.env.example

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
APP_NAME=PJ Blog
12
APP_ENV=local
23
APP_KEY=
34
APP_DEBUG=true
4-
APP_LOG_LEVEL=debug
55
APP_URL=http://localhost
66

7+
LOG_CHANNEL=stack
8+
79
DB_CONNECTION=mysql
810
DB_HOST=127.0.0.1
911
DB_PORT=3306
@@ -13,25 +15,33 @@ DB_PASSWORD=secret
1315

1416
BROADCAST_DRIVER=log
1517
CACHE_DRIVER=file
16-
SESSION_DRIVER=file
1718
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
1821

1922
REDIS_HOST=127.0.0.1
2023
REDIS_PASSWORD=null
2124
REDIS_PORT=6379
2225

2326
MAIL_DRIVER=smtp
24-
MAIL_HOST=
25-
MAIL_PORT=
26-
MAIL_USERNAME=
27-
MAIL_PASSWORD=
28-
MAIL_ENCRYPTION=
29-
MAIL_FROM=Example
30-
MAIL_NAME=Example
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
33+
AWS_ACCESS_KEY_ID=
34+
AWS_SECRET_ACCESS_KEY=
35+
AWS_DEFAULT_REGION=us-east-1
36+
AWS_BUCKET=
3137

3238
PUSHER_APP_ID=
3339
PUSHER_APP_KEY=
3440
PUSHER_APP_SECRET=
41+
PUSHER_APP_CLUSTER=mt1
42+
43+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
44+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
3545

3646
GITHUB_CLIENT_ID=
3747
GITHUB_CLIENT_SECRET=

app/Http/Kernel.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ class Kernel extends HttpKernel
1414
* @var array
1515
*/
1616
protected $middleware = [
17-
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
17+
\App\Http\Middleware\CheckForMaintenanceMode::class,
1818
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
1919
\App\Http\Middleware\TrimStrings::class,
2020
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
21+
\App\Http\Middleware\TrustProxies::class,
2122
];
2223

2324
/**
@@ -51,14 +52,33 @@ class Kernel extends HttpKernel
5152
* @var array
5253
*/
5354
protected $routeMiddleware = [
54-
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
55+
'auth' => \App\Http\Middleware\Authenticate::class,
5556
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
5657
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
58+
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
5759
'can' => \Illuminate\Auth\Middleware\Authorize::class,
5860
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
61+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
5962
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
63+
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
6064
'admin' => \App\Http\Middleware\MustBeAdmin::class,
6165
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
6266
'permission' => \App\Http\Middleware\PermissionMiddleware::class,
6367
];
68+
69+
/**
70+
* The priority-sorted list of middleware.
71+
*
72+
* This forces non-global middleware to always be in the given order.
73+
*
74+
* @var array
75+
*/
76+
protected $middlewarePriority = [
77+
\Illuminate\Session\Middleware\StartSession::class,
78+
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
79+
\App\Http\Middleware\Authenticate::class,
80+
\Illuminate\Session\Middleware\AuthenticateSession::class,
81+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
82+
\Illuminate\Auth\Middleware\Authorize::class,
83+
];
6484
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Auth\Middleware\Authenticate as Middleware;
6+
7+
class Authenticate extends Middleware
8+
{
9+
/**
10+
* Get the path the user should be redirected to when they are not authenticated.
11+
*
12+
* @param \Illuminate\Http\Request $request
13+
* @return string
14+
*/
15+
protected function redirectTo($request)
16+
{
17+
if (! $request->expectsJson()) {
18+
return route('login');
19+
}
20+
}
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
6+
7+
class CheckForMaintenanceMode extends Middleware
8+
{
9+
/**
10+
* The URIs that should be reachable while maintenance mode is enabled.
11+
*
12+
* @var array
13+
*/
14+
protected $except = [
15+
//
16+
];
17+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Http\Request;
6+
use Fideloper\Proxy\TrustProxies as Middleware;
7+
8+
class TrustProxies extends Middleware
9+
{
10+
/**
11+
* The trusted proxies for this application.
12+
*
13+
* @var array
14+
*/
15+
protected $proxies;
16+
17+
/**
18+
* The headers that should be used to detect proxies.
19+
*
20+
* @var int
21+
*/
22+
protected $headers = Request::HEADER_X_FORWARDED_ALL;
23+
}

app/Http/Middleware/VerifyCsrfToken.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
namespace App\Http\Middleware;
44

5-
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
5+
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
66

7-
class VerifyCsrfToken extends BaseVerifier
7+
class VerifyCsrfToken extends Middleware
88
{
9+
/**
10+
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
11+
*
12+
* @var bool
13+
*/
14+
protected $addHttpCookie = true;
15+
916
/**
1017
* The URIs that should be excluded from CSRF verification.
1118
*
@@ -14,4 +21,4 @@ class VerifyCsrfToken extends BaseVerifier
1421
protected $except = [
1522
//
1623
];
17-
}
24+
}

app/Providers/EventServiceProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace App\Providers;
44

55
use Illuminate\Support\Facades\Event;
6+
use Illuminate\Auth\Events\Registered;
7+
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
68
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
79

810
class EventServiceProvider extends ServiceProvider
@@ -13,8 +15,8 @@ class EventServiceProvider extends ServiceProvider
1315
* @var array
1416
*/
1517
protected $listen = [
16-
'App\Events\SomeEvent' => [
17-
'App\Listeners\EventListener',
18+
Registered::class => [
19+
SendEmailVerificationNotification::class,
1820
],
1921
];
2022

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"jcc/laravel-vote": "dev-master",
1414
"jellybool/flysystem-upyun": "dev-master",
1515
"jellybool/translug": "~2.0",
16-
"laravel/framework": "5.7.*",
16+
"laravel/framework": "5.8.*",
1717
"laravel/passport": "^7.0",
1818
"laravel/socialite": "^3.0",
1919
"laravel/tinker": "~1.0",

0 commit comments

Comments
 (0)