@if (count($courier_orders) <= 4) @php $x = ceil(count($courier_orders) / 2); @endphp @else @php $y = ceil(count($courier_orders) / 2); $x = ceil(count($courier_orders) / $y); @endphp @endif @foreach (array_chunk($courier_orders, $x) as $orders) @foreach ($orders as $data) @php $setting = App\Setting::first(); $city = \App\City::where('id', $setting->city)->first(); $sale_id = $data['sale_id']; $sale = \Illuminate\Support\Facades\DB::table('sales') ->where('sales.id', $sale_id) ->join('contacts', 'sales.contact_id', '=', 'contacts.id') ->leftjoin('districts', 'contacts.district_id', '=', 'districts.id') ->leftjoin('cities', 'contacts.city', '=', 'cities.id') ->select( 'sales.*', 'contacts.*', 'districts.name_en as districtName', 'cities.name_en as cityName', ) ->first(); $item_names = \Illuminate\Support\Facades\DB::table('sale_items') ->join('products', 'sale_items.product_id', '=', 'products.id') ->where('sale_id', $sale_id) ->where('sale_items.deleted_at', null) ->get(); @endphp


{!! $sale->name !!}

{!! $sale->landmark !!}

{!! $sale->mobile !!}


{{ $sale->invoice_no }} {!! number_format($sale->invoice_nettotal, 2) !!}

@endforeach @endforeach