/** * @return JSON with reagents list which expiration date is closer than one week. */ public function getCloseToExpirationDate() { $date = new \DateTime(); $date->add(new \DateInterval('P7D')); $date = $date->format('Y-m-d'); $odczynniki = Odczynnik::where('data_waznosci', '<=', $date)->get(); return response()->json($odczynniki); }