@extends('backend.layouts.app') @section('content') {{-- Stats --}} @php $total = $inquiries->total(); $todayCount = \App\Models\CustomerInquiry::whereDate('created_at', today())->count(); $newCount = \App\Models\CustomerInquiry::where(function($q){ $q->where('lead_status','new')->orWhereNull('lead_status'); })->count(); $interested = \App\Models\CustomerInquiry::where('lead_status','interested')->count(); $unmatched = \App\Models\CustomerInquiry::whereNull('seller_id')->count(); $conversion = $total > 0 ? round(($interested/$total)*100,1) : 0; @endphp
{{ $total }}
Total
{{ $todayCount }}
Today
{{ $newCount }}
🆕 Pending
{{ $interested }}
✅ Interested
{{ $unmatched }}
âš ī¸ Unmatched
{{ $conversion }}%
Conversion
📋 Customer Enquiries
Export @can('send_inquiry') @endcan
{{-- Filters --}}
@if($inquiries->count() > 0)
@foreach($inquiries as $key => $inq) @php $status = $inq->lead_status ?? 'new'; $isUnmatched = !$inq->seller_id; $shop = $inq->seller_id ? \App\Models\Shop::where('user_id',$inq->seller_id)->first() : null; $shopName = $shop->name ?? ($inq->seller->name ?? '—'); $phone = preg_replace('/\D/','',$inq->buyer_phone ?? ''); @endphp @endforeach
# Buyer Category / Product Seller / Shop Location Status Quote Notified Date Actions
{{ $inq->id }} @if($inq->IsRead == 0)
NEW@endif
{{ $inq->buyer_name ?: 'Guest' }}
@if($inq->buyer_phone) đŸ’Ŧ WA @endif
@if($inq->category) {{ $inq->category->name }}
@endif @if($inq->product_name) {{ Str::limit($inq->product_name,30) }} @endif
@if($isUnmatched) âš ī¸ Unmatched
@else
{{ $shopName }}
@if($inq->seller && $inq->seller->phone) {{ $inq->seller->phone }} @endif @endif
@if($inq->city)
{{ $inq->city }}
@if($inq->district){{ $inq->district }}, {{ $inq->state }}@endif @else — @endif
@if($inq->quoted_amount) ₹{{ number_format($inq->quoted_amount) }} @else — @endif @php $notifCount = \DB::table('enquiry_notifications')->where('enquiry_id',$inq->id)->count(); @endphp @if($notifCount > 0) {{ $notifCount }} sellers @else Unmatched @endif
{{ $inq->created_at->format('d M Y') }}
{{ $inq->created_at->diffForHumans() }}
@can('view_inquiry') @endcan @can('send_user_details_inquiry') @if($inq->is_customer_interested == 'no') @endif @endcan @can('delete_user_details_inquiry') @endcan
{{ $inquiries->appends(request()->input())->links() }}
@else

No enquiries found

@endif
{{-- Assign Seller Modal --}} {{-- Toast --}} @endsection @section('modal') {{-- Send Enquiry Modal --}} @endsection @section('script') @endsection