update to l7

This commit is contained in:
Russ Long 2022-08-06 13:58:30 -04:00
parent bc534f4d74
commit 17f6924abb
5 changed files with 8064 additions and 741 deletions

View File

@ -2,64 +2,49 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
/** /**
* A list of the exception types that should not be reported. * A list of exception types with their corresponding custom log levels.
* *
* @var array * @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/ */
protected $dontReport = [ protected $levels = [
\Illuminate\Auth\AuthenticationException::class, //
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
]; ];
/** /**
* Report or log an exception. * A list of the exception types that are not reported.
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
* *
* @param \Exception $exception
* @return void * @return void
*/ */
public function report(Exception $exception) public function register()
{ {
parent::report($exception); $this->reportable(function (Throwable $e) {
//
});
} }
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}
return redirect()->guest(route('login'));
}
}

View File

@ -8,14 +8,15 @@
"php": ">=7.0.0", "php": ">=7.0.0",
"barryvdh/laravel-snappy": "^0.4.1", "barryvdh/laravel-snappy": "^0.4.1",
"carlos-meneses/laravel-mpdf": "^2.1", "carlos-meneses/laravel-mpdf": "^2.1",
"laravel/framework": "6.0.*", "laravel/framework": "^7.0",
"laravel/tinker": "~1.0" "laravel/tinker": "^2.0",
"laravel/ui": "^2.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-debugbar": "^3.2",
"filp/whoops": "~2.0", "filp/whoops": "~2.0",
"mockery/mockery": "0.9.*", "mockery/mockery": "0.9.*",
"phpunit/phpunit": "~7.0" "phpunit/phpunit": "^8.5"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [

2163
composer.lock generated

File diff suppressed because it is too large Load Diff

6558
composer.lock.bak Normal file

File diff suppressed because it is too large Load Diff

View File

@ -161,7 +161,7 @@ return [
| |
*/ */
'secure' => env('SESSION_SECURE_COOKIE', false), 'secure' => env('SESSION_SECURE_COOKIE', null),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------