@extends('web.signup.layout') @section('title', __('web.startup_initial_dd.title')) @section('page_title', __('web.startup_initial_dd.start.hero_title')) @section('page_subtitle', '') @section('body_class', 'has-sticky-logo') @push('styles') @endpush @section('content')
$existingByType->get($type, collect())->isNotEmpty(), ])->values()->all()), requiredMsg: @js(__('web.startup_initial_dd.upload.required_missing')), })" x-cloak> {{-- Identity strip + sign-out --}}
{{ $startup->display_name ?: $startup->name_en }}
{{ __('web.startup_initial_dd.upload.identity_subtitle') }}
{{-- Relative URL keeps the form same-origin with the page even when the user is hitting a different host than APP_URL (e.g. local-network test from a phone). Same-origin submits skip iOS Safari's "not secure" cross-origin warning. --}}
@csrf
@if (session('flash'))
{{ session('flash')['message'] ?? '' }}
@endif @if ($errors->any())
{{ __('web.startup_initial_dd.upload.errors_heading') }}
@endif {{-- Per-field upload errors from the last submit. The accepted documents were already saved (they show under "Already on file"); only the highlighted fields below need fixing + resubmitting. --}} @php $ddFieldErrors = session('dd_field_errors', []); @endphp @if (! empty($ddFieldErrors))
{{ __('web.startup_initial_dd.upload.errors_heading') }}
@endif {{-- Client-side required-field gate (mirrors the server rules). --}}
{{ __('web.startup_initial_dd.upload.errors_heading') }}
@csrf @php /* Group document types by category for the visual section headings. The Alpine `ddUploadForm` factory keeps the same order so the queue + the rendered DOM stay aligned. */ $byCategory = collect($documentTypes) ->map(fn ($spec, $type) => ['type' => $type] + $spec) ->groupBy('category'); $categoryLabels = [ \App\Models\File::DD_CATEGORY_LEGAL => __('web.startup_initial_dd.upload.category.legal_documents'), \App\Models\File::DD_CATEGORY_FINANCIAL => __('web.startup_initial_dd.upload.category.financial_documents'), \App\Models\File::DD_CATEGORY_OTHER => __('web.startup_initial_dd.upload.category.other'), ]; @endphp @foreach ($byCategory as $catKey => $items)

{{ $categoryLabels[$catKey] ?? $catKey }} {{ $items->count() }}

@foreach ($items as $item) @php $type = $item['type']; $required = (bool) $item['required']; $label = __($item['label_key']); $existing = $existingByType->get($type, collect()); $fieldErrs = $ddFieldErrors[$type] ?? []; @endphp
{{ $label }} @if ($required) * @else {{ __('web.startup_initial_dd.upload.doc.optional_label') }} @endif
{{-- Per-field validation error (kept open so the user fixes exactly this document without losing others). --}} @if (! empty($fieldErrs))
    @foreach ($fieldErrs as $err)
  • {{ $err }}
  • @endforeach
@endif {{-- Queue: files just picked, not yet submitted. --}}
{{-- Already on file (read-only view) --}} @if ($existing->isNotEmpty())
{{ __('web.startup_initial_dd.upload.doc.existing_title') }}
    @foreach ($existing as $f)
  • {{ $f->file_name }}
  • @endforeach
@endif
@endforeach
@endforeach
@endsection @push('scripts') @endpush