Skip to content

Commit

Permalink
Update AddBirthdayValidation.php (#20)
Browse files Browse the repository at this point in the history
Password recovery: The birthdays field is required #19

#19
  • Loading branch information
Litalino committed Jan 27, 2024
1 parent eb6aeab commit 56e3a9d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/AddBirthdayValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __invoke(UserValidator $flarumValidator, Validator $validator):
&& $this->settings->get('datlechin-birthdays.set_on_registration');

$rules['birthday'] = [
'sometimes',
Rule::when($isRequired && ! $flarumValidator->getUser(), 'required', 'nullable'),
'date',
sprintf('before:-%s years', (int) $this->settings->get('datlechin-birthdays.min_age')),
Expand Down

0 comments on commit 56e3a9d

Please sign in to comment.