@extends('admin.layouts.app') @section('page-title', 'Profile Update Requests') @section('content')
@php $perPage = 5; $currentPage = request()->get('page', 1); $currentPage = max(1, (int)$currentPage); $total = $requests->count(); $currentItems = $requests->slice(($currentPage - 1) * $perPage, $perPage); @endphp

Profile Update Requests ({{ $total }})

@foreach($currentItems as $index => $req) @php $user = $req->user; $newData = is_array($req->data) ? $req->data : json_decode($req->data, true); @endphp
#{{ ($currentPage - 1) * $perPage + $index + 1 }}
{{ $user->customer_name }}
{{ $user->email }}
ID: {{ $user->customer_id }}
@if($req->status == 'pending') Pending @elseif($req->status == 'approved') Approved @else Rejected @endif
{{ $req->created_at->format('d M Y, h:i A') }}
@if($req->status == 'pending') ✔ Approve ✖ Reject @else Completed @endif
@foreach(['customer_name','company_name','email'] as $field) @php $old = $user->$field ?? '—'; $new = $newData[$field] ?? $old; @endphp
{{ ucfirst(str_replace('_',' ', $field)) }}
Old: {{ $old }}
New: {{ $new }}
@endforeach
@foreach(['mobile_no','address','pincode'] as $field) @php $old = $user->$field ?? '—'; $new = $newData[$field] ?? $old; @endphp
{{ ucfirst(str_replace('_',' ', $field)) }}
Old: {{ $old }}
New: {{ $new }}
@endforeach
@endforeach
@endsection