@extends('layouts.app') @section('title', 'Submission #' . $submission->id) @section('content')
Submission Details {!! lead_status_badge($submission->lead_status_id) !!}
Source
{!! source_badge($submission->source ?? 'website') !!}
Form Name
{{ $submission->form_name }}
Date
{{ format_date($submission->created_at) }}
Visitor Name
{{ $submission->visitor_name ?? '-' }}
Email
@if($submission->visitor_email){{ $submission->visitor_email }}@if($submission->is_repeated) Repeated lead@endif @else - @endif
Phone
{{ $submission->visitor_phone ?? '-' }}
@if(auth()->user()->isSuperAdmin())
Client
{{ $submission->client->company_name ?? '-' }}
@endif
Project
@if($submission->project){{ $submission->project->name }}@else - @endif
@if($submission->assignedUser && !($canAssignSubmission ?? false))
Assigned to
{{ $submission->assignedUser->name }}
@endif @if($submission->is_repeated)
Repeated lead Same client, project, form, and email was submitted on a previous date.
@endif
Form Data
@forelse(collect($submission->form_data ?? [])->except('_meta') as $key => $value) @empty @endforelse
FieldValue
{{ str_contains((string) $key, '_') ? ucwords(str_replace('_', ' ', $key)) : $key }} @if(is_array($value)){{ json_encode($value) }}@else{{ $value }}@endif
No form data
@if($submission->isMetaLead())
Meta Lead Ads
@if($submission->metaConnection) @endif
Leadgen ID{{ $submission->external_id ?? '-' }}
Page ID{{ $submission->meta_page_id ?? '-' }}
Form ID{{ $submission->meta_form_id ?? '-' }}
Campaign ID{{ $submission->meta_campaign_id ?? '-' }}
Ad Set ID{{ $submission->meta_adset_id ?? '-' }}
Ad ID{{ $submission->meta_ad_id ?? '-' }}
Connected Page{{ $submission->metaConnection->page_name ?? $submission->metaConnection->page_id }}
@endif
Tracking Information
IP Address{{ $submission->ip_address ?? '-' }}
Country{{ $submission->country ?? '-' }}
Browser{{ $submission->browser ?? '-' }}
OS{{ $submission->operating_system ?? '-' }}
Referrer @if($submission->referrer && filter_var($submission->referrer, FILTER_VALIDATE_URL)) {{ Str::limit($submission->referrer, 40) }} @elseif(($submission->source ?? '') === 'meta' || $submission->referrer === 'meta_lead_ads') Meta Lead Ads @elseif(($submission->source ?? '') === '99acres') 99acres @elseif(($submission->source ?? '') === 'whatsapp' || $submission->referrer === 'whatsapp_ctwa') WhatsApp{{ $submission->referrer === 'whatsapp_ctwa' ? ' (ad)' : '' }} @elseif($submission->referrer) {{ $submission->referrer }} @else - @endif
Submitted URL@if($submission->submitted_url && filter_var($submission->submitted_url, FILTER_VALIDATE_URL)){{ Str::limit($submission->submitted_url, 40) }}@else - @endif
UTM Source{{ $submission->utm_source ?? '-' }}
UTM Medium{{ $submission->utm_medium ?? '-' }}
UTM Campaign{{ $submission->utm_campaign ?? '-' }}
Notes & Follow-ups
@php $upcomingReminders = $submission->notes->filter(fn ($note) => $note->reminder_at && $note->reminder_at->isFuture()); @endphp @if($upcomingReminders->isNotEmpty())
Upcoming follow-ups
@foreach($upcomingReminders as $reminderNote)
{{ format_date($reminderNote->reminder_at) }} — {{ Str::limit($reminderNote->message, 80) }}
@endforeach
@endif
@forelse($submission->notes as $note)
{{ $note->user->name ?? 'System' }} · {{ format_date($note->created_at) }} @if($note->wasMessageEdited()) Edited · {{ format_date($note->edited_at) }} @endif
{{ $note->message }}
@include('admin.submissions.partials.note-attachments-list', ['submission' => $submission, 'note' => $note])
@csrf @method('PUT') @include('admin.submissions.partials.note-attachment-fields')
@if($note->reminder_at)
Follow-up: {{ format_date($note->reminder_at) }} @if($note->reminder_at->isPast()) (past) @endif
Calendar: {{ submission_note_calendar_title($note, $submission) }} · {{ reminder_duration_options()[$note->reminderDurationMinutes()] ?? '30 minutes' }}
@if($googleCalendarUrl = submission_note_google_calendar_url($note, $submission)) Add to Google Calendar @endif Download .ics
@csrf @method('PUT') @include('admin.submissions.partials.reminder-fields', [ 'reminderAtValue' => reminder_datetime_local_value($note->reminder_at), 'reminderTitleValue' => $note->reminder_title, 'reminderDurationValue' => $note->reminderDurationMinutes(), ])
@endif
@empty

No notes yet

@endforelse
@csrf
@include('admin.submissions.partials.note-attachment-fields')
@include('admin.submissions.partials.reminder-fields', [ 'reminderAtValue' => old('reminder_at'), 'reminderTitleValue' => old('reminder_title'), 'reminderDurationValue' => old('reminder_duration_minutes', 30), ])
Status
@csrf
@if($submission->lead_status_updated_by)

Last updated by {{ $submission->leadStatusUpdatedBy?->name ?? 'Unknown user' }} @if($submission->lead_status_updated_at) · {{ format_date($submission->lead_status_updated_at) }} @endif

@endif
@if($canAssignSubmission ?? false)
Assigned to
@if($assignableUsers->isEmpty())

No active project users available. Link users to this project first.

@else
@csrf

@if($submission->client?->lead_round_robin_enabled) Manual assign only changes this lead. New leads still use round-robin from the last auto-assigned user, not this selection. @elseif($submission->client?->lead_manual_assign_restrict) Project users see only leads you assign to them. Use unassigned count on the dashboard to distribute work. @else All project users can see every lead; assignment here is optional for tracking only. @endif

@endif
@elseif($submission->assignedUser)
Assigned to
{{ $submission->assignedUser->name }}
@endif @if(isset($assigneeHistory) && $assigneeHistory->isNotEmpty())
Assignment history
    @foreach($assigneeHistory as $entry) @php $props = $entry->properties ?? []; $fromId = $props['from_user_id'] ?? null; $toId = $props['to_user_id'] ?? null; $fromName = $fromId ? ($assigneeHistoryNames[$fromId] ?? "#{$fromId}") : 'None'; $toName = $toId ? ($assigneeHistoryNames[$toId] ?? "#{$toId}") : '—'; $via = match ($props['source'] ?? '') { 'round_robin' => 'Round-robin', 'role_change' => 'Role change', default => 'Manual', }; $by = $entry->user?->name ?? (in_array($props['source'] ?? '', ['round_robin', 'role_change'], true) ? 'System' : '—'); @endphp
  • {{ format_date($entry->created_at) }}
    {{ $fromName }} → {{ $toName }}
    {{ $via }} · by {{ $by }}
  • @endforeach
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush