@extends('layouts.admin') @section('title', 'Bulk Import Members') @section('page_title', 'Bulk Import Members') @section('content') {{-- IMPORT RESULTS --}} @if(session('import_results')) @php $results = session('import_results'); @endphp {{-- SUMMARY --}}
{{ $results['total'] }}
Total Rows
{{ $results['created'] }}
✅ Created Successfully
{{ $results['failed'] }}
❌ Failed
{{-- SUCCESS LIST --}} @if(count($results['success']) > 0)
Successfully Created ({{ count($results['success']) }})
@foreach($results['success'] as $s) @endforeach
Row Name Email Status
#{{ $s['row'] }} {{ $s['name'] }} {{ $s['email'] }} Created
@endif {{-- ERROR LIST --}} @if(count($results['errors']) > 0)
Failed Rows ({{ count($results['errors']) }})
@foreach($results['errors'] as $e) @endforeach
Row Name Email Errors
#{{ $e['row'] }} {{ $e['name'] }} {{ $e['email'] }} @foreach($e['errors'] as $err)
• {{ $err }}
@endforeach
@endif @endif {{-- HOW TO USE --}}
How to Import Members
1️⃣
Download Template
Download the CSV template and fill member data
2️⃣
Fill Data
Fill member details in Excel or Google Sheets
3️⃣
Upload & Import
Upload the CSV file and system creates all members
{{-- REFERENCE IDs --}}
{{-- STATES --}}
States (state_id)
@foreach(\App\Models\State::all() as $state) @endforeach
IDName
{{ $state->id }} {{ $state->name }}
{{-- PLANS --}}
Plans (plan_id)
@foreach(\App\Models\MembershipPlan::all() as $plan) @endforeach
IDNameAmount
{{ $plan->id }} {{ $plan->name }} ₹{{ number_format((float) ($plan->amount ?? 0), 0) }}
{{-- DISTRICTS & UNITS REFERENCE --}}
Districts & Units Reference
@foreach(\App\Models\Unit::with('district.state')->get() as $unit) @endforeach
District ID District State Unit ID Unit Name
{{ $unit->district_id }} {{ $unit->district->name }} {{ $unit->district->state->name }} {{ $unit->id }} {{ $unit->name }}
{{-- UPLOAD FORM --}}
Upload CSV File
Download Template
@csrf
{{-- DROP ZONE --}}
📄
Click to select or drag & drop CSV file
Only .csv files accepted · Max 2MB
{{-- CSV COLUMN GUIDE --}}
📋 CSV Column Order:
@foreach(['name','email','phone','password','dob (YYYY-MM-DD)','gender (male/female/other)','organization','designation','experience','address','pincode','state_id','district_id','unit_id','plan_id','website (optional)'] as $i => $col) {{ $i+1 }}. {{ $col }} @endforeach
All imported members will have PENDING status. Unit Admin must approve each member.
@endsection @section('scripts') @endsection