toDateString(); // dd($currentdate->toDateString()); $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); $arrayID = []; foreach($lelong as $data) { array_push($arrayID,$data->id); } $lelongbid = LelongBid::whereIn('lelong_id',$arrayID) ->join('lelongbidmarhun','lelongbid.id','=','lelongbidmarhun.lelongbid_id') ->get(); $surat = LelongBid::whereIn('lelong_id',$arrayID)->get(); if(sizeof($lelongbid)!=0) { return response()->json([ 'success' => true, 'lelong' => $lelong, 'surat' => $surat, 'item' => $lelongbid ]); } else { return response()->json([ 'success' => false, 'message' => 'No Data', ], 401); } } }