Skip to content

Commit b8ce617

Browse files
committed
Merge branch 'shift-4241'
2 parents cedfb39 + cde28f6 commit b8ce617

23 files changed

Lines changed: 2438 additions & 1980 deletions

File tree

app/Console/Kernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ protected function schedule(Schedule $schedule)
2929
}
3030

3131
/**
32-
* Register the Closure based commands for the application.
32+
* Register the commands for the application.
3333
*
3434
* @return void
3535
*/
3636
protected function commands()
3737
{
38+
$this->load(__DIR__.'/Commands');
39+
3840
require base_path('routes/console.php');
3941
}
4042
}

app/Conversations/ExampleConversation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ public function run()
4242
{
4343
$this->askReason();
4444
}
45-
}
45+
}

app/Exceptions/Handler.php

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@
33
namespace App\Exceptions;
44

55
use Exception;
6-
use Illuminate\Auth\AuthenticationException;
76
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
87

98
class Handler extends ExceptionHandler
109
{
1110
/**
12-
* A list of the exception types that should not be reported.
11+
* A list of the exception types that are not reported.
1312
*
1413
* @var array
1514
*/
1615
protected $dontReport = [
17-
\Illuminate\Auth\AuthenticationException::class,
18-
\Illuminate\Auth\Access\AuthorizationException::class,
19-
\Symfony\Component\HttpKernel\Exception\HttpException::class,
20-
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
21-
\Illuminate\Session\TokenMismatchException::class,
22-
\Illuminate\Validation\ValidationException::class,
16+
//
17+
];
18+
19+
/**
20+
* A list of the inputs that are never flashed for validation exceptions.
21+
*
22+
* @var array
23+
*/
24+
protected $dontFlash = [
25+
'password',
26+
'password_confirmation',
2327
];
2428

2529
/**
@@ -46,20 +50,4 @@ public function render($request, Exception $exception)
4650
{
4751
return parent::render($request, $exception);
4852
}
49-
50-
/**
51-
* Convert an authentication exception into an unauthenticated response.
52-
*
53-
* @param \Illuminate\Http\Request $request
54-
* @param \Illuminate\Auth\AuthenticationException $exception
55-
* @return \Illuminate\Http\Response
56-
*/
57-
protected function unauthenticated($request, AuthenticationException $exception)
58-
{
59-
if ($request->expectsJson()) {
60-
return response()->json(['error' => 'Unauthenticated.'], 401);
61-
}
62-
63-
return redirect()->guest(route('login'));
64-
}
6553
}

app/Http/Controllers/BotManController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public function startConversation(BotMan $bot)
3434
{
3535
$bot->startConversation(new ExampleConversation());
3636
}
37-
}
37+
}

app/Http/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Kernel extends HttpKernel
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
/**

app/Http/Middleware/EncryptCookies.php

Lines changed: 2 additions & 2 deletions
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.

app/Http/Middleware/TrimStrings.php

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

33
namespace App\Http\Middleware;
44

5-
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
5+
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
66

7-
class TrimStrings extends BaseTrimmer
7+
class TrimStrings extends Middleware
88
{
99
/**
1010
* The names of the attributes that should not be trimmed.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 current proxy header mappings.
19+
*
20+
* @var array
21+
*/
22+
protected $headers = [
23+
Request::HEADER_FORWARDED => 'FORWARDED',
24+
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
25+
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
26+
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
27+
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
28+
];
29+
}

app/Http/Middleware/VerifyCsrfToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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
{
99
/**
1010
* The URIs that should be excluded from CSRF verification.

app/Providers/BotMan/DriverServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ public function boot()
2626
DriverManager::loadDriver($driver);
2727
}
2828
}
29-
30-
}
29+
}

0 commit comments

Comments
 (0)