From 4f46e755152a7d71ba64f27c7b8595110968a9ee Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 12 Aug 2020 14:39:00 -0400 Subject: [PATCH] Check for active flag for user fields in registration --- app/Http/Controllers/Auth/RegisterController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index b59d572e..ac05fa23 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -92,7 +92,12 @@ class RegisterController extends Controller ]; // 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) { $rules['field_'.$field->slug] = 'required'; }