@foreach($npdData as $key => $value) @php $data = DB::connection('mysql2')->table('supplier as s') ->select('s.ntn', 's.cnic', 's.name', 's.city', 'si.address', 's.company_status', 's.company_name') ->leftJoin('supplier_info as si', 's.id', '=', 'si.supp_id') ->where('s.id', $value->supplier_id) ->first(); $Taxable_Amount = DB::connection('mysql2')->table('new_pv_data') ->where('paid_to_id', $value->supplier_id) ->where('pv_no', $value->pv_no) ->where('debit_credit', 1) ->first(); $city = CommonHelper::get_all_cities_by_id($data->city); $city = (!empty($city)) ? $city->name : '' ; @endphp