mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 11:34:36 +08:00
parent
333bb702ed
commit
f22c792fe0
|
@ -59,7 +59,9 @@ class SaveSuspensionToDatabase
|
|||
|
||||
$this->assertCan($actor, 'suspend', $user);
|
||||
|
||||
$user->suspend_until = new DateTime($attributes['suspendUntil']);
|
||||
$user->suspend_until = $attributes['suspendUntil']
|
||||
? new DateTime($attributes['suspendUntil'])
|
||||
: null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ class SuspendValidator extends AbstractValidator
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected $rules = [
|
||||
'suspendUntil' => ['date'],
|
||||
'suspendUntil' => ['nullable', 'date'],
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user