*/ public function rules(): array { return [ 'label' => ['sometimes', 'string', 'max:255'], 'options' => ['nullable', 'array'], 'options.*' => ['required'], 'options.*.label' => ['required_if:options.*,array', 'string', 'max:255'], 'options.*.description' => ['nullable', 'string', 'max:200'], 'tag_categories' => ['nullable', 'array'], 'tag_categories.*' => ['string', 'max:50'], 'is_required' => ['nullable', 'boolean'], 'is_portal_visible' => ['nullable', 'boolean'], 'is_admin_only' => ['nullable', 'boolean'], 'is_filterable' => ['nullable', 'boolean'], 'help_text' => ['nullable', 'string', 'max:5000'], 'sort_order' => ['nullable', 'integer', 'min:0'], 'display_width' => ['sometimes', Rule::in(array_column(FieldDisplayWidth::cases(), 'value'))], ]; } }