Skip to content

Commit 8976287

Browse files
Merge pull request #32 from ExposureSoftware/shift-157060
Laravel 9.x Shift
2 parents c1225a7 + 684ae1a commit 8976287

45 files changed

Lines changed: 260 additions & 216 deletions

Some content is hidden

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

app/Console/Kernel.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@
77

88
class Kernel extends ConsoleKernel
99
{
10-
/**
11-
* The Artisan commands provided by your application.
12-
*
13-
* @var array
14-
*/
15-
protected $commands = [
16-
//
17-
];
18-
1910
/**
2011
* Define the application's command schedule.
2112
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2313
* @return void
2414
*/
2515
protected function schedule(Schedule $schedule)

app/Exceptions/Handler.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@
77

88
class Handler extends ExceptionHandler
99
{
10+
/**
11+
* A list of exception types with their corresponding custom log levels.
12+
*
13+
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
14+
*/
15+
protected $levels = [
16+
//
17+
];
18+
1019
/**
1120
* A list of the exception types that are not reported.
1221
*
13-
* @var array
22+
* @var array<int, class-string<\Throwable>>
1423
*/
1524
protected $dontReport = [
1625
//
1726
];
1827

1928
/**
20-
* A list of the inputs that are never flashed for validation exceptions.
29+
* A list of the inputs that are never flashed to the session on validation exceptions.
2130
*
22-
* @var array
31+
* @var array<int, string>
2332
*/
2433
protected $dontFlash = [
2534
'current_password',

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function __construct()
4444
/**
4545
* Get a validator for an incoming registration request.
4646
*
47-
* @param array $data
4847
* @return \Illuminate\Contracts\Validation\Validator
4948
*/
5049
protected function validator(array $data)
@@ -59,7 +58,6 @@ protected function validator(array $data)
5958
/**
6059
* Create a new user instance after a valid registration.
6160
*
62-
* @param array $data
6361
* @return \App\User
6462
*/
6563
protected function create(array $data)

app/Http/Kernel.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ class Kernel extends HttpKernel
1111
*
1212
* These middleware are run during every request to your application.
1313
*
14-
* @var array
14+
* @var array<int, class-string|string>
1515
*/
1616
protected $middleware = [
1717
// \App\Http\Middleware\TrustHosts::class,
1818
\App\Http\Middleware\TrustProxies::class,
19-
\Fruitcake\Cors\HandleCors::class,
19+
\Illuminate\Http\Middleware\HandleCors::class,
2020
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
2121
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2222
\App\Http\Middleware\TrimStrings::class,
@@ -26,20 +26,20 @@ class Kernel extends HttpKernel
2626
/**
2727
* The application's route middleware groups.
2828
*
29-
* @var array
29+
* @var array<string, array<int, class-string|string>>
3030
*/
3131
protected $middlewareGroups = [
3232
'web' => [
3333
\App\Http\Middleware\EncryptCookies::class,
3434
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
3535
\Illuminate\Session\Middleware\StartSession::class,
36-
// \Illuminate\Session\Middleware\AuthenticateSession::class,
3736
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
3837
\App\Http\Middleware\VerifyCsrfToken::class,
3938
\Illuminate\Routing\Middleware\SubstituteBindings::class,
4039
],
4140

4241
'api' => [
42+
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
4343
'throttle:api',
4444
\Illuminate\Routing\Middleware\SubstituteBindings::class,
4545
],
@@ -50,16 +50,17 @@ class Kernel extends HttpKernel
5050
*
5151
* These middleware may be assigned to groups or used individually.
5252
*
53-
* @var array
53+
* @var array<string, class-string|string>
5454
*/
5555
protected $routeMiddleware = [
5656
'auth' => \App\Http\Middleware\Authenticate::class,
5757
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58+
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
5859
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
5960
'can' => \Illuminate\Auth\Middleware\Authorize::class,
6061
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
6162
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
62-
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
63+
'signed' => \App\Http\Middleware\ValidateSignature::class,
6364
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
6465
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
6566
];

app/Http/Middleware/PreventRequestsDuringMaintenance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PreventRequestsDuringMaintenance extends Middleware
99
/**
1010
* The URIs that should be reachable while maintenance mode is enabled.
1111
*
12-
* @var array
12+
* @var array<int, string>
1313
*/
1414
protected $except = [
1515
//

app/Http/Middleware/RedirectIfAuthenticated.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ class RedirectIfAuthenticated
1212
/**
1313
* Handle an incoming request.
1414
*
15-
* @param \Illuminate\Http\Request $request
16-
* @param \Closure $next
15+
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
1716
* @param string|null ...$guards
18-
* @return mixed
17+
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
1918
*/
2019
public function handle(Request $request, Closure $next, ...$guards)
2120
{

app/Http/Middleware/TrimStrings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TrimStrings extends Middleware
99
/**
1010
* The names of the attributes that should not be trimmed.
1111
*
12-
* @var array
12+
* @var array<int, string>
1313
*/
1414
protected $except = [
1515
'current_password',

app/Http/Middleware/TrustHosts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TrustHosts extends Middleware
99
/**
1010
* Get the host patterns that should be trusted.
1111
*
12-
* @return array
12+
* @return array<int, string|null>
1313
*/
1414
public function hosts()
1515
{

app/Http/Middleware/TrustProxies.php

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

33
namespace App\Http\Middleware;
44

5-
use Fideloper\Proxy\TrustProxies as Middleware;
5+
use Illuminate\Http\Middleware\TrustProxies as Middleware;
66
use Illuminate\Http\Request;
77

88
class TrustProxies extends Middleware
99
{
1010
/**
1111
* The trusted proxies for this application.
1212
*
13-
* @var array|string|null
13+
* @var array<int, string>|string|null
1414
*/
1515
protected $proxies;
1616

@@ -19,5 +19,10 @@ class TrustProxies extends Middleware
1919
*
2020
* @var int
2121
*/
22-
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
22+
protected $headers =
23+
Request::HEADER_X_FORWARDED_FOR |
24+
Request::HEADER_X_FORWARDED_HOST |
25+
Request::HEADER_X_FORWARDED_PORT |
26+
Request::HEADER_X_FORWARDED_PROTO |
27+
Request::HEADER_X_FORWARDED_AWS_ELB;
2328
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
6+
7+
class ValidateSignature extends Middleware
8+
{
9+
/**
10+
* The names of the query string parameters that should be ignored.
11+
*
12+
* @var array<int, string>
13+
*/
14+
protected $except = [
15+
// 'fbclid',
16+
// 'utm_campaign',
17+
// 'utm_content',
18+
// 'utm_medium',
19+
// 'utm_source',
20+
// 'utm_term',
21+
];
22+
}

0 commit comments

Comments
 (0)