Files
crewli/api/app/Http/Requests/Api/V1/UpdateRegistrationFormFieldRequest.php
bert.hausmans d57dcdb616 feat: HEADING field type for registration forms — replace section property with structural field
Replace the per-field `section` text property with a dedicated HEADING field type that
organizers add as a separate block for visual grouping. Also fixes duplicate heading bug
on portal radio fields, replaces cramped VBtnToggle with VSelect for field width, and
adds grouped field type dropdown with structure/input categories.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 16:40:41 +02:00

38 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Api\V1;
use App\Enums\FieldDisplayWidth;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
final class UpdateRegistrationFormFieldRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/** @return array<string, mixed> */
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_category' => ['nullable', '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'))],
];
}
}