toDateTimeString(); $procurementQuotations=ProcurementQuotation::query() ->with('procurement.ownerMaterial.material') ->where('status',0) ->whereNull('offer') ->where('created_at','>=',Carbon::parse($now)->subHours(4)) ->where('created_at','<=',$now) ->get(); foreach ($procurementQuotations as $procurementQuotation){ $procurementQuotation->append('time',4); } if (!empty($procurementQuotations))return response()->json(['status'=>1,'data'=>$procurementQuotations->toJson()], 200); } }