protected function saveRules(CustomField $field, Field $customfield)
    {
        $rules = array_get($field->getRules(), $field->name, []);
        foreach ($rules as $rule) {
            $validator = FieldValidator::query()->where(['name' => $rule])->first();
            $config    = [
                'field_id' => $customfield->id
            ];
            if (is_null($validator)) {
                $validator       = FieldValidator::query()->where(['name' => 'custom'])->firstOrFail();
                $config['value'] = $rule;
            }
            array_set($config, 'validator_id', $validator->id);
            FieldValidatorConfig::query()->firstOrNew($config)->save();
        }
        return true;
    }