Check for active flag for user fields in registration

This commit is contained in:
Nabeel Shahzad 2020-08-12 14:39:00 -04:00
parent 3ac03d9716
commit 4f46e75515

View File

@ -92,7 +92,12 @@ class RegisterController extends Controller
]; ];
// Dynamically add the required fields // Dynamically add the required fields
$userFields = UserField::where(['show_on_registration' => true, 'required' => true])->get(); $userFields = UserField::where([
'show_on_registration' => true,
'required' => true,
'active' => true,
])->get();
foreach ($userFields as $field) { foreach ($userFields as $field) {
$rules['field_'.$field->slug] = 'required'; $rules['field_'.$field->slug] = 'required';
} }