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

Due Diligence Requests

DD Requests Table
@foreach($requests as $dd) @endforeach
ID Listing Total Price Status Services Actions
{{ $dd->id }} {{ $dd->listing->title ?? '-' }} Currency{{ number_format($dd->price,2) }} @php // Normalize services JSON $jsonServices = $dd->services; if (is_string($jsonServices)) { $jsonServices = json_decode($jsonServices, true); } $jsonServices = is_array($jsonServices) ? $jsonServices : []; // Convert DB-based services to array for comparison $dbServices = $dd->serviceReports->pluck('service.name')->filter()->toArray(); @endphp
    {{-- Show all DB services --}} @foreach($dd->serviceReports as $srv)
  • {{ $srv->service->name ?? '' }}: @if($srv->report_file) View PDF @else
    @endif
  • @endforeach {{-- Show remaining JSON services that aren't in DB --}} @foreach($jsonServices as $srv) @if(!in_array($srv, $dbServices))
  • {{ $srv }}No report uploaded
  • @endif @endforeach
@if($dd->serviceReports->isEmpty() && empty($jsonServices)) No services found @endif
View
@endsection @section('script') @endsection