From 3e4f8084aef1b59577eb1e776fb57c082c2069e8 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 2 Jul 2023 00:03:35 +0100 Subject: [PATCH] fix(suspensions): fix missing datetime cast A missing datetime cast caused issues in the suspension service, where it tried calling Carbon methods on a string (which should have been a Carbon instance). --- app/Ban.php | 2 +- app/Exceptions/Handler.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Ban.php b/app/Ban.php index c88278b..b9124ff 100755 --- a/app/Ban.php +++ b/app/Ban.php @@ -36,7 +36,7 @@ class Ban extends Model ]; public $casts = [ - 'bannedUntil', + 'bannedUntil' => 'datetime', ]; public function user() diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index ebe7e96..51c0c2e 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -57,13 +57,13 @@ class Handler extends ExceptionHandler * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Throwable $exception + * @param \Throwable $e * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable */ - public function render($request, Throwable $exception) + public function render($request, Throwable $e) { - return parent::render($request, $exception); + return parent::render($request, $e); } }