@extends('layouts.admin-master') @section('title', 'Vendor Verifications') @section('style') @include('admin.style') @endsection @section('content')
@include('admin.header')
@php $latestVerification = $business->verifications->sortByDesc('created_at')->first(); $status = $latestVerification->overall_status ?? null; @endphp {{-- PAGE HEADER --}}

{{ $business->business_name }}

{{ $business->business_email }}
@if (in_array(optional(auth()->user()->role)->alias, ['SADM', 'ARAD']))
@if ($status === 'approved') Approved @elseif ($status === 'rejected') Rejected @else
@csrf
@endif
@endif
{{-- MAIN CARD --}}
{{-- TABS --}}
{{-- OVERVIEW --}}
Business Info
Category
{{ $business->category->name ?? 'N/A' }}
Subcategory
{{ $business->subcategory->name ?? 'N/A' }}
Location
State
{{ $business->state->state_name ?? 'N/A' }}
City
{{ $business->city->city_name ?? 'N/A' }}
District
{{ $business->district->district_name ?? 'N/A' }}
Zone
{{ $business->zone->name ?? 'N/A' }}
Zonal Area
{{ $business->zonalArea->name ?? 'N/A' }}
Address
{{ $business->address }}
{{-- SOCIAL LINKS --}}
Social Links
{{-- Facebook --}} @if ($business->socialLinks && $business->socialLinks->facebook_url) {{ $business->socialLinks->facebook_url }} @else N/A @endif {{-- Instagram --}}
Instagram @if ($business->socialLinks?->instagram_url) {{ $business->socialLinks->instagram_url }} @else N/A @endif
{{-- Twitter --}}
Twitter @if ($business->socialLinks?->twitter_url) {{ $business->socialLinks->twitter_url }} @else N/A @endif
{{-- Website --}}
Website @if ($business->socialLinks?->website_url) {{ $business->socialLinks->website_url }} @else N/A @endif
{{-- SHOP --}}
Logo
@if ($business->details?->shop_logo) @endif
Banner
@if ($business->details?->shop_banner) @endif
Description:

{{ $business->details->shop_description ?? 'N/A' }}

About:

{{ $business->details->about_business ?? 'N/A' }}

{{-- HOURS --}}
{{-- Header --}}
Operating Hours
{{-- Table Head --}} {{-- Table Body --}} @foreach ($business->operatingHours as $hour) {{-- Day --}} {{-- Open --}} {{-- Close --}} {{-- Status --}} @endforeach
Day Opening Time Closing Time Status
{{ ucfirst($hour->day) }} {{ $hour->open_time ?? '-' }} {{ $hour->close_time ?? '-' }} {{ $hour->is_closed ? 'Closed' : 'Open' }}
{{-- REGIONS --}}
@foreach ($business->serviceableRegions as $region)
{{ $region->state->state_name ?? '' }}, {{ $region->city->city_name ?? '' }}, {{ $region->district->district_name ?? '' }} - {{ $region->pincode }}
@endforeach
{{-- GOVERNMENT TAB --}} @php $role = auth('web')->user()->role->alias; $isVolunteer = $role === 'VOL'; $isAdmin = in_array($role, ['SADM', 'ARAD']); @endphp
@foreach ($business->governmentIds as $id)
{{-- ID INFO --}} {{ $id->id_type }}
{{ $id->id_number }} {{-- DOCUMENT --}} @if ($id->id_document) @php $fileUrl = asset('storage/' . $id->id_document); $ext = strtolower(pathinfo($fileUrl, PATHINFO_EXTENSION)); @endphp
@if (in_array($ext, ['jpg', 'jpeg', 'png'])) @elseif ($ext === 'pdf') View PDF @endif
@endif {{-- STATUS --}}
Status: {{ $id->verification_status == 'volunteer_approved' ? 'Pending Admin Approval' : ucfirst($id->verification_status) }}
{{-- REMARKS --}}
@if ($id->remarks) Remark: {{ $id->remarks }} @endif
{{-- ACTION BUTTONS --}}
{{-- VOLUNTEER --}} @if ($isVolunteer && $id->verification_status == 'pending') @endif {{-- ADMIN --}} @if ($isAdmin && $id->verification_status == 'volunteer_approved') @endif {{-- ALREADY APPROVED --}} @if ($id->verification_status == 'approved') Already Approved @endif
@endforeach
{{-- MODAL --}} {{-- REGISTRATIONS --}} @php $role = auth('web')->user()->role->alias; $isVolunteer = $role === 'VOL'; $isAdmin = in_array($role, ['SADM', 'ARAD']); @endphp
@foreach ($business->registrations as $reg)
{{ $reg->registration_type }}
{{ $reg->registration_number ?? 'N/A' }} @if ($reg->registration_document) @php $fileUrl = asset('storage/' . $reg->registration_document); $ext = strtolower(pathinfo($fileUrl, PATHINFO_EXTENSION)); @endphp
@if (in_array($ext, ['jpg', 'jpeg', 'png'])) @elseif ($ext === 'pdf') View PDF @endif
@endif {{-- STATUS --}}
Status: {{ $reg->verification_status == 'volunteer_approved' ? 'Pending Admin Approval' : ucfirst($reg->verification_status) }}
{{-- REMARKS --}}
@if ($reg->remarks) Remark: {{ $reg->remarks }} @endif
{{-- ACTIONS --}}
{{-- VOLUNTEER --}} @if ($isVolunteer && $reg->verification_status == 'pending') @endif {{-- ADMIN --}} @if ($isAdmin && $reg->verification_status == 'volunteer_approved') @endif
@endforeach
{{-- MODAL --}} {{-- PRODUCTS --}}
@foreach ($products as $product)
{{ $product->name }}

{{ Str::limit($product->description, 70) }}

₹{{ $product->pricing->price ?? 0 }}
@endforeach
{{-- Staff Details --}}
@foreach ($business->staffDetails as $staff)
{{-- HEADER --}}
{{ $staff->first_name }} {{ $staff->last_name }}
{{ ucfirst($staff->status) }}
{{-- CONTACT --}}
📞 {{ $staff->phone }}
📧 {{ $staff->email }}
@php $role = auth()->user()->role->alias; $allDocsApproved = $staff->documents->count() > 0 && $staff->documents->every( fn($doc) => $doc->status === 'approved', ); @endphp @if (in_array($role, ['SADM', 'ARAD']) && $staff->status !== 'active' && $allDocsApproved)
@endif {{-- DOCUMENTS --}}
Documents:
@foreach ($staff->documents as $doc)
{{ str_replace('_', ' ', $doc->status) }} @php $role = auth()->user()->role->alias; @endphp @if ($role === 'VOL' && $doc->status === 'pending') @endif @if (in_array($role, ['ARAD', 'SADM']) && $doc->status === 'volunteer_approved') @endif
@endforeach
@endforeach
{{-- HISTORY --}}
@foreach ($business->verifications as $verification)
{{ ucfirst($verification->overall_status) }}
{{ $verification->verified_at }} | {{ $verification->user->name ?? 'N/A' }}
@if ($verification->remarks)
{{ $verification->remarks }}
@endif
@endforeach
@endsection @section('script') @include('admin.script') {{-- Government ID Verification Scripts --}} @endsection