@extends('layouts.app') @section('content')

Header Mapping & Import Options

@csrf
File: {{ $file_name }}
Detected headers: {{ count($headers) }} @if(isset($matched_profile) && $matched_profile)
Auto-matched profile: {{ $matched_profile->name }} @endif
Header Mapping
@php $effectiveMap = $profile_mapping ?? ($matched_profile ? $matched_profile->fields->mapWithKeys(fn($f)=>[$f->excel_header => ['target_type'=>$f->target_type,'target_table'=>$f->target_table,'target_field'=>$f->target_field,'is_ignored'=>$f->is_ignored]])->all() : $auto_mapping); $customerFields = ['first_name','last_name','full_name','email','phone','alt_phone','address_line1','address_line2','city','state','pincode','country','company','designation','department','industry','source','primary_tag']; @endphp @foreach($headers as $i => $header) @php $rowMap = $effectiveMap[$header] ?? ['target_type'=>'ignore','target_field'=>null,'target_table'=>null]; @endphp @endforeach
Excel Header Target Type Customer/Pseudo Field Dynamic Table Target Field
{{ $header }}
@foreach($dynamicTables as $t) @endforeach
Preview Rows
@foreach($headers as $header)@endforeach @foreach($rows as $row) @foreach($headers as $header)@endforeach @endforeach
{{ $header }}
{{ $row[$header] ?? '' }}
Unmapped headers detected: highlight rows in yellow. For each, choose Ignore, Customer Field, Existing Custom Table, Create New Custom Table (enter new table name + field), or Store in Attributes (EAV).
@endsection @push('scripts') @endpush