@foreach($orderwise_listing_locations as $row)
@if($row->total == '')
@php $row->total = 0; @endphp
@endif
@endforeach
{{ $row->listing_location_name }}
@php $qty = 0; $locationProperties = App\Models\Listing::where('listing_location_id', $row->id)->where('listing_status','Active')->get(); foreach ($locationProperties as $key => $brandListing) { if($brandListing->user_id != 0){ $activePackage = App\Models\PackagePurchase::where('user_id',$brandListing->user_id)->where('currently_active',1)->first(); if($activePackage->package_end_date >= date('Y-m-d')){ $qty += 1; } }else{ $qty += 1; } } @endphp{{ $qty }} {{ ITEMS }}