Sets nullable attribute on validation

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-10-12 10:30:47 -07:00
parent 3f105cd3b2
commit 0312ecf09d

View file

@ -923,8 +923,8 @@ class SettingsController extends Controller
$validator = Validator::make($setting->toArray(), [
'ldap_username_field' => 'not_in:sAMAccountName',
'ldap_auth_filter_query' => 'not_in:uid=samaccountname',
'ldap_filter' => 'regex:"^[^(]"',
'ldap_auth_filter_query' => 'not_in:uid=samaccountname|required_if:ldap_enabled,1',
'ldap_filter' => 'nullable|regex:"^[^(]"|required_if:ldap_enabled,1',
], $messages);