feat(form-builder): FormFieldValidationRuleService + legacy backfill + snapshot + library row-copy
This commit is contained in:
@@ -6,6 +6,7 @@ namespace App\Http\Resources\FormBuilder;
|
||||
|
||||
use App\Models\FormBuilder\FormFieldLibrary;
|
||||
use App\Services\FormBuilder\FormFieldBindingService;
|
||||
use App\Services\FormBuilder\FormFieldValidationRuleService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
@@ -28,7 +29,9 @@ final class FormFieldLibraryResource extends JsonResource
|
||||
'label' => $this->label,
|
||||
'help_text' => $this->help_text,
|
||||
'options' => $this->options,
|
||||
'validation_rules' => $this->validation_rules,
|
||||
'validation_rules' => app(FormFieldValidationRuleService::class)->toJsonShape(
|
||||
$this->resource->validationRules,
|
||||
),
|
||||
'default_is_required' => (bool) $this->default_is_required,
|
||||
'default_is_filterable' => (bool) $this->default_is_filterable,
|
||||
'default_binding' => app(FormFieldBindingService::class)->toJsonShape(
|
||||
|
||||
Reference in New Issue
Block a user