/** * Show rankings for last X months * * @param int $monthsBack Score for specific month * @return mixed */ public function scoreLastMonths($monthsBack = 1) { $repos = new ResultsRepository(); return ['title' => $monthsBack === 1 ? 'Last 31 days' : 'Last ' . $monthsBack . ' ' . str_plural('month', $monthsBack), 'type' => 'from', 'months_back' => $monthsBack, 'results' => $repos->getScoreLastMonths($monthsBack)]; }
/** * Show rankings for last X months * * @param Request $request * @return mixed */ public function scoreLastMonths(Request $request) { $repos = new ResultsRepository(); return view('game-of-tests::results.list', ['type' => 'from', 'months_back' => $request->input('monthsBack', 0), 'results' => $repos->getScoreLastMonths($request->input('monthsBack', 0))]); }