if (config('registration.email_required', true)) { $emailValidator[] = 'NotEmpty'; $emailValidator['EmailAddress'] = [ 'allow' => Hostname::ALLOW_DNS, 'useMxCheck' => true, 'useDeepMxCheck' => true, ]; }