コード例 #1
0
 /**
  *
  * @param WeightsRepository $weightsRepository
  * @return \Illuminate\View\View
  */
 public function entries(WeightsRepository $weightsRepository)
 {
     $date = Carbon::today()->format('Y-m-d');
     JavaScript::put(["menuEntries" => $this->menuEntriesRepository->getEntriesForTheDay($date), "caloriesForTheDay" => $this->caloriesRepository->getCaloriesForDay($date), "calorieAverageFor7Days" => $this->caloriesRepository->getCaloriesFor7Days($date)]);
     return view('main.home-page');
 }
コード例 #2
0
 /**
  * Get the user's total calories for the day
  * @param $date
  * @return mixed
  */
 public function show($date)
 {
     return ['forTheDay' => $this->caloriesRepository->getCaloriesForDay($date), 'averageFor7Days' => $this->caloriesRepository->getCaloriesFor7Days($date)];
 }