Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 906c57e

Browse files
committed
Upgrade to Laravel 5.8
1 parent 1f5cd69 commit 906c57e

Some content is hidden

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

49 files changed

+2573
-946
lines changed

Diff for: .editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 4
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[*.yml]
16+
indent_size = 2

Diff for: .env.example

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1+
APP_NAME=Laravel
12
APP_ENV=local
23
APP_KEY=SomeRandomString
34
APP_DEBUG=true
45
APP_LOG_LEVEL=debug
56
APP_URL=http://localhost
67

8+
LOG_CHANNEL=stack
9+
710
DB_CONNECTION=mysql
811
DB_HOST=127.0.0.1
912
DB_PORT=3306
1013
DB_DATABASE=homestead
1114
DB_USERNAME=homestead
1215
DB_PASSWORD=secret
1316

17+
BROADCAST_DRIVER=log
1418
CACHE_DRIVER=file
19+
QUEUE_CONNECTION=sync
1520
SESSION_DRIVER=file
21+
SESSION_LIFETIME=120
1622
QUEUE_DRIVER=database
1723

1824
REDIS_HOST=127.0.0.1
1925
REDIS_PASSWORD=null
2026
REDIS_PORT=6379
2127

2228
MAIL_DRIVER=smtp
23-
MAIL_HOST=mailtrap.io
29+
MAIL_HOST=smtp.mailtrap.io
2430
MAIL_PORT=2525
2531
MAIL_USERNAME=null
2632
MAIL_PASSWORD=null
@@ -70,3 +76,18 @@ VERSION_HASH=
7076
IONIC_PUSH_PROFILE=
7177

7278
IONIC_API_TOKEN=
79+
80+
81+
82+
AWS_ACCESS_KEY_ID=
83+
AWS_SECRET_ACCESS_KEY=
84+
AWS_DEFAULT_REGION=us-east-1
85+
AWS_BUCKET=
86+
87+
PUSHER_APP_ID=
88+
PUSHER_APP_KEY=
89+
PUSHER_APP_SECRET=
90+
PUSHER_APP_CLUSTER=mt1
91+
92+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
93+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Diff for: .gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* text=auto
22
*.css linguist-vendored
33
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

Diff for: .gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/vendor
22
/node_modules
33
/public/uploads
4+
/public/hot
5+
/public/storage
6+
/storage/*.key
47
Homestead.yaml
58
Homestead.json
69
.env
@@ -13,5 +16,7 @@ site.sh
1316
storage/debugbar
1417
storage/qrcodes/
1518
storage/trombi-phones/
16-
19+
.phpunit.result.cache
20+
npm-debug.log
21+
yarn-error.log
1722
/storage/oauth-*

Diff for: app/Console/Kernel.php

+12
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ protected function schedule(Schedule $schedule)
2929
{
3030
$schedule->command('integration:mails:to-queue')->everyTenMinutes();
3131
}
32+
33+
/**
34+
* Register the commands for the application.
35+
*
36+
* @return void
37+
*/
38+
protected function commands()
39+
{
40+
$this->load(__DIR__.'/Commands');
41+
42+
require base_path('routes/console.php');
43+
}
3244
}

Diff for: app/Http/Controllers/Challenges/ChallengeValidationController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private function generateUrlForVideo(string $url) : string
6666
}
6767

6868
public function list() {
69-
$validations_pending = ChallengeValidation::where('validated', '=', 0)->orderBy('submittedOn', 'last_update', 'desc')->get();
69+
$validations_pending = ChallengeValidation::where('validated', '=', 0)->orderBy('submittedOn','desc')->orderBy('last_update','desc')->get();
7070
$validations_treated = ChallengeValidation::where('validated', '=', -1)->orWhere('validated', '=', 1)->orderBy('last_update', 'desc')->get();
7171
return view('dashboard.challenges.submissions', compact('validations_pending', 'validations_treated'));
7272
}

Diff for: app/Http/Kernel.php

+21
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,30 @@ class Kernel extends HttpKernel
4949
'cors' => \Barryvdh\Cors\HandleCors::class,
5050
'auth' => \App\Http\Middleware\Authenticate::class,
5151
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
52+
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
53+
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
54+
'can' => \Illuminate\Auth\Middleware\Authorize::class,
5255
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
56+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
5357
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
5458
'oauth' => \App\Http\Middleware\OAuth::class,
5559
'authorize' => \App\Http\Middleware\Authorize::class,
60+
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
61+
];
62+
63+
/**
64+
* The priority-sorted list of middleware.
65+
*
66+
* This forces non-global middleware to always be in the given order.
67+
*
68+
* @var array
69+
*/
70+
protected $middlewarePriority = [
71+
\Illuminate\Session\Middleware\StartSession::class,
72+
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
73+
\App\Http\Middleware\Authenticate::class,
74+
\Illuminate\Session\Middleware\AuthenticateSession::class,
75+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
76+
\Illuminate\Auth\Middleware\Authorize::class,
5677
];
5778
}

Diff for: app/Http/Middleware/Authenticate.php

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
namespace App\Http\Middleware;
44

55
use Closure;
6+
use Illuminate\Auth\Middleware\Authenticate as Middleware;
67
use Illuminate\Support\Facades\Auth;
78

8-
class Authenticate
9+
class Authenticate extends Middleware
910
{
11+
/**
12+
* Get the path the user should be redirected to when they are not authenticated.
13+
*
14+
* @param \Illuminate\Http\Request $request
15+
* @return string
16+
*/
17+
protected function redirectTo($request)
18+
{
19+
if (! $request->expectsJson()) {
20+
return route('login');
21+
}
22+
}
23+
1024
/**
1125
* Handle an incoming request.
1226
*
@@ -15,9 +29,9 @@ class Authenticate
1529
* @param string|null $guard
1630
* @return mixed
1731
*/
18-
public function handle($request, Closure $next, $guard = null)
32+
public function handle($request, Closure $next, ...$guards)
1933
{
20-
if (Auth::guard($guard)->guest()) {
34+
if (Auth::guard($guards)->guest()) {
2135
if ($request->ajax() || $request->wantsJson()) {
2236
return response('Unauthorized.', 401);
2337
} else {

Diff for: app/Http/Middleware/CheckForMaintenanceMode.php

+17
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+
}

Diff for: app/Http/Middleware/EncryptCookies.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace App\Http\Middleware;
44

5-
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
5+
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
66

7-
class EncryptCookies extends BaseEncrypter
7+
class EncryptCookies extends Middleware
88
{
99
/**
1010
* The names of the cookies that should not be encrypted.

Diff for: app/Http/Middleware/TrimStrings.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
6+
7+
class TrimStrings extends Middleware
8+
{
9+
/**
10+
* The names of the attributes that should not be trimmed.
11+
*
12+
* @var array
13+
*/
14+
protected $except = [
15+
'password',
16+
'password_confirmation',
17+
];
18+
}

Diff for: app/Http/Middleware/TrustProxies.php

+23
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+
}

Diff for: app/Http/Middleware/VerifyCsrfToken.php

+9-2
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
*

Diff for: app/Providers/RouteServiceProvider.php

+15-19
Original file line numberDiff line numberDiff line change
@@ -36,45 +36,41 @@ public function boot(/**Router $router**/)
3636
* @param \Illuminate\Routing\Router $router
3737
* @return void
3838
*/
39-
public function map(Router $router)
39+
public function map()
4040
{
41-
$this->mapWebRoutes($router);
41+
$this->mapWebRoutes();
4242

43-
$this->mapApiRoutes($router);
43+
$this->mapApiRoutes();
4444
}
4545

4646
/**
4747
* Define the "web" routes for the application.
4848
*
4949
* These routes all receive session state, CSRF protection, etc.
5050
*
51-
* @param \Illuminate\Routing\Router $router
5251
* @return void
5352
*/
54-
protected function mapWebRoutes(Router $router)
53+
protected function mapWebRoutes()
5554
{
56-
$router->group([
57-
'namespace' => $this->namespace, 'middleware' => 'web',
58-
], function ($router) {
59-
require base_path('routes/web.php');
60-
});
55+
Route::middleware('web')
56+
->namespace($this->namespace)
57+
->group(base_path('routes/web.php'));
6158
}
6259

6360
/**
6461
* Define the "api" routes for the application
6562
*
66-
* @param \Illuminate\Routing\Router $router
63+
* These routes are typically stateless.
64+
*
6765
* @return void
6866
*/
69-
protected function mapApiRoutes(Router $router)
67+
protected function mapApiRoutes()
7068
{
71-
$router->group([
72-
'middleware' => ['cors'],
73-
'namespace' => $this->namespace,
74-
'prefix' => 'api',
75-
], function ($router) {
76-
require base_path('routes/api.php');
77-
});
69+
Route::prefix('api')
70+
->middleware('api')
71+
->namespace($this->namespace)
72+
->prefix('api')
73+
->group(base_path('routes/api.php'));
7874
}
7975

8076
}

Diff for: artisan

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env php
22
<?php
33

4+
define('LARAVEL_START', microtime(true));
5+
46
/*
57
|--------------------------------------------------------------------------
68
| Register The Auto Loader
@@ -13,7 +15,7 @@
1315
|
1416
*/
1517

16-
require __DIR__.'/bootstrap/autoload.php';
18+
require __DIR__.'/vendor/autoload.php';
1719

1820
$app = require_once __DIR__.'/bootstrap/app.php';
1921

@@ -40,7 +42,7 @@ $status = $kernel->handle(
4042
| Shutdown The Application
4143
|--------------------------------------------------------------------------
4244
|
43-
| Once Artisan has finished running. We will fire off the shutdown events
45+
| Once Artisan has finished running, we will fire off the shutdown events
4446
| so that any final work may be done by the application before we shut
4547
| down the process. This is the last thing to happen to the request.
4648
|

Diff for: bootstrap/app.php

+1-1
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
/*

0 commit comments

Comments
 (0)