- Restructure field editor dialog: move Options section to bottom with divider and subheader, fix delete button with flex layout - Change tag_category (single string) to tag_categories (JSON array) supporting multiple category selection in tag picker fields - Portal tag picker now groups tags by category with subheaders - Add generic file upload endpoint (FileUploadService + UploadController) - Replace email branding logo URL text field with ImageUploadField - Update Partner crowd type default icon to tabler-affiliate - Apply changes consistently to both field and template dialogs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
use App\Enums\FieldDisplayWidth;
|
|
use App\Enums\RegistrationFieldType;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
final class UpdateRegistrationFieldTemplateRequest 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_categories' => ['nullable', 'array'],
|
|
'tag_categories.*' => ['string', 'max:50'],
|
|
'is_required' => ['nullable', 'boolean'],
|
|
'is_filterable' => ['nullable', 'boolean'],
|
|
'is_portal_visible' => ['nullable', 'boolean'],
|
|
'is_admin_only' => ['nullable', 'boolean'],
|
|
'help_text' => ['nullable', 'string', 'max:5000'],
|
|
'sort_order' => ['nullable', 'integer', 'min:0'],
|
|
'display_width' => ['sometimes', Rule::in(array_column(FieldDisplayWidth::cases(), 'value'))],
|
|
];
|
|
}
|
|
}
|