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