From 95bf7c239e6ec23313a3f838023814ce2fd2e4dd Mon Sep 17 00:00:00 2001 From: Miguel N Date: Mon, 7 Sep 2020 23:38:25 +0100 Subject: [PATCH] Update ban time logic --- app/Http/Controllers/BanController.php | 2 +- app/Policies/BanPolicy.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/BanController.php b/app/Http/Controllers/BanController.php index bd46424..55a0204 100644 --- a/app/Http/Controllers/BanController.php +++ b/app/Http/Controllers/BanController.php @@ -56,7 +56,7 @@ class BanController extends Controller $ban = Ban::create([ 'userID' => $user->id, 'reason' => $reason, - 'bannedUntil' => $expiryDate->toDateTimeString() ?? null, + 'bannedUntil' => $expiryDate, 'userAgent' => "Unknown", 'authorUserID' => Auth::user()->id ]); diff --git a/app/Policies/BanPolicy.php b/app/Policies/BanPolicy.php index 979bb52..fff0ee4 100644 --- a/app/Policies/BanPolicy.php +++ b/app/Policies/BanPolicy.php @@ -38,7 +38,8 @@ class BanPolicy /** * Determine whether the user can create models. * - * @param \App\User $user + * @param \App\User $user + * @param User $targetUser * @return mixed */ public function create(User $user, User $targetUser)