Update ban time logic

This commit is contained in:
Miguel Nogueira 2020-09-07 23:38:25 +01:00
parent 4d2595dd39
commit 95bf7c239e
2 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,7 @@ class BanController extends Controller
$ban = Ban::create([ $ban = Ban::create([
'userID' => $user->id, 'userID' => $user->id,
'reason' => $reason, 'reason' => $reason,
'bannedUntil' => $expiryDate->toDateTimeString() ?? null, 'bannedUntil' => $expiryDate,
'userAgent' => "Unknown", 'userAgent' => "Unknown",
'authorUserID' => Auth::user()->id 'authorUserID' => Auth::user()->id
]); ]);

View File

@ -39,6 +39,7 @@ class BanPolicy
* Determine whether the user can create models. * Determine whether the user can create models.
* *
* @param \App\User $user * @param \App\User $user
* @param User $targetUser
* @return mixed * @return mixed
*/ */
public function create(User $user, User $targetUser) public function create(User $user, User $targetUser)