@php($displayLeadName = !empty($leadId) ? (($lead->full_name ?? '') !== '' ? ($lead->full_name ?? '') : ($lead->dba ?? '')) : '') @php($pageTitle = !empty($pageTitle) ? $pageTitle . ($displayLeadName !== '' ? ' (' . $displayLeadName . ')' : '') : '') @csrf @if(!empty($leadId)) @method('PUT') @endif
@include('admin.components.admin-form-wrapper')
{{-- ── TOP LEFT CARD ── --}}
@if(!empty($allTabForm2) && count($allTabForm2) > 0) @php($tabI = 0) @foreach($allTabForm2 as $tabId => $fieldForm) @php($tabTitle = strtolower(trim($fieldForm['tabInfo']->title ?? ''))) @php($tabType = (int)($fieldForm['tabInfo']->type ?? 1))
@if($tabTitle === 'e-sign' && !empty($leadId)) {{-- E-Sign custom tab content --}} @include('admin.leads.partials.esign_tab_content') @elseif($tabTitle === 'web forms' && !empty($leadId)) {{-- Web Forms custom tab content --}} @include('admin.leads.partials.webforms_tab_content') @elseif($tabTitle === 'e-sign' || $tabTitle === 'web forms') {{-- E-Sign / Web Forms on create mode: show placeholder --}}

Save the lead first to access {{ $fieldForm['tabInfo']->title ?? '' }}.

@elseif($tabType == 1)
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@elseif($tabType == 2)
{{$fieldForm['tabInfo']->title ?? ''}} #__INDEX__
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@else {{-- Tab types 3-7 (Custom Documents, Funding, Custom Notes, Payments, Invoices) --}}
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@endif
@php($tabI++) @endforeach @endif
{{-- End TOP LEFT CARD --}} {{-- ── BOTTOM LEFT CARD ── --}} @if(!empty($leadId) && !empty($formTabListBottom) && count($formTabListBottom) > 0)
@if(!empty($allTabForm2Bottom) && count($allTabForm2Bottom) > 0) @php($tabI = 0) @foreach($allTabForm2Bottom as $tabId => $fieldForm) @php($tabTitleB = strtolower(trim($fieldForm['tabInfo']->title ?? ''))) @php($tabTypeB = (int)($fieldForm['tabInfo']->type ?? 1))
@if($tabTitleB === 'e-sign' && !empty($leadId)) @include('admin.leads.partials.esign_tab_content') @elseif($tabTitleB === 'web forms' && !empty($leadId)) @include('admin.leads.partials.webforms_tab_content') @elseif($tabTitleB === 'notes' && !empty($leadId)) @include('admin.leads.partials.notes_tab', ['leadId' => $leadId]) @elseif($tabTitleB === 'tickets' && !empty($leadId)) @include('admin.leads.partials.tickets_tab', ['leadId' => $leadId]) @elseif($tabTitleB === 'e-sign' || $tabTitleB === 'web forms' || $tabTitleB === 'notes' || $tabTitleB === 'tickets')

Save the lead first to access {{ $fieldForm['tabInfo']->title ?? '' }}.

@elseif($tabTypeB == 1)
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@elseif($tabTypeB == 2)
{{$fieldForm['tabInfo']->title ?? ''}} #__INDEX__
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@else
@php($form = $fieldForm) @include('admin.components.admin-form-wrapper')
@endif
@php($tabI++) @endforeach @endif
{{-- End BOTTOM LEFT CARD --}} @endif
@php($rightCardContentMap = [ 'assigned users' => 'admin.leads.partials.assigned_users_actions', 'activity' => null, 'actions' => 'admin.leads.partials.actions_content', 'proposals' => 'admin.leads.partials.proposals_content', 'details' => 'admin.leads.partials.details_section_content', 'equipment orders' => 'admin.leads.partials.equipment_orders_section', 'e-sign' => 'admin.leads.partials.esign_section', 'events' => 'admin.leads.partials.events_section_content', ]) @if(empty($leadId)) @endif @php($rightPanelCards = !empty($leadId) ? ['formTabListR1' => 'rightCard1', 'formTabListR2' => 'rightCard2', 'formTabListR3' => 'rightCard3', 'formTabListR4' => 'rightCard4'] : ['formTabListR3' => 'rightCard3'] ) @foreach($rightPanelCards as $tabListVar => $cardId) @php($rightTabs = $$tabListVar ?? collect()) @if(empty($leadId) && $tabListVar === 'formTabListR3') @php($rightTabs = $rightTabs->filter(fn($t) => strtolower(trim($t->title)) === 'details')->values()) @endif @if($rightTabs->count() > 0)
{{-- Card header with tabs + collapse chevron --}}
{{-- Card body with tab content --}}
{{-- Create Lead button moved above right panel cards for create mode --}}
@foreach($rightTabs as $rIdx => $rTab) @php($rTabKey = strtolower(trim($rTab->title)))
@if(isset($rightCardContentMap[$rTabKey]) && $rightCardContentMap[$rTabKey]) @include($rightCardContentMap[$rTabKey]) @else
{{ $rTab->title }} content coming soon.
@endif
@endforeach
@endif @endforeach
@push('page_script') @endpush