Show rankings for last X months

@param Request $request
@return mixed
190162
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))
            ]
        );
    }
715631
public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;

        if (!empty($keyword)) {
            $activitylogs = Activity::where('description', 'LIKE', "%$keyword%")
                ->latest()->paginate($perPage);
        } else {
            $activitylogs = Activity::latest()->paginate($perPage);
        }

        return view('admin.activitylogs.index', compact('activitylogs'));
    }
517934
public static function calculateYearsAgo(DateDiffRequest $request)
    {
        return new DateDiffResult($request, self::YEARS_AGO, $request->getInterval()->y);
    }
718241
public function index(Request $request)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        // Get all pagetypes
        $pagetypes = PageType::orderBy('updated_at', 'desc')
            ->orderBy('created_at', 'desc')
            ->paginate(self::PAGINATION_ITEMS);

        return view('page::pagetypes.index', ['pagetypes' => $pagetypes]);
    }
1041104
public function sort(Request $request)
    {
        collect($request->get('files'))
            ->each(function ($sort, $id) {
                $attachment = Attachment::find($id);
                $attachment->sort = $sort;
                $attachment->save();
            });

        return response(200);
    }
1180385
public function index(Request $request)
    {
        $categories = $this->repository->allOrSearch($request->get('q'));

        $no = $categories->firstItem();

        return $this->view('categories.index', compact('categories', 'no'));
    }
676590
public function index(Request $request)
    {
        $notifications = $this->service->userBasedPaginated(Auth::id());
        return view('notifications.index')->with('notifications', $notifications);
    }
689490
public function listAction(Request $request)
    {
        $current_page = $request->get('page', 1);
        $current_page = $current_page > 1 ? $current_page : 1;
        $rep = $this->getRepository();

        // filter list notice
        $filter = $this->createForm('notices_filter')->handleRequest($request);
        if ($filter->isValid()) {
            $query = $rep->getFilteredQuery($filter->getData()['status'], $filter->getData()['type']);
        } else {
            $query = $rep->createQueryBuilder('n');
        }
        $query
            ->orderBy('n.date_created', 'DESC')
            ->setFirstResult(($current_page - 1) * self::NOTICE_PER_PAGE)
            ->setMaxResults(self::NOTICE_PER_PAGE);
        $list = $query->getQuery()->getResult();

        // get count all items
        $count = $query
            ->select('COUNT(n)')
            ->getQuery()
            ->getSingleScalarResult();

        // pagination
        $that = $this;
        $request_query = $request->query->all();
        unset($request_query['page']);
        $pagination = $this->get('anime_db.pagination')
            ->create(ceil($count / self::NOTICE_PER_PAGE), $current_page)
            ->setPageLink(function ($page) use ($that, $request_query) {
                return $that->generateUrl('notice_list', array_merge($request_query, ['page' => $page]));
            })
            ->setFirstPageLink($this->generateUrl('notice_list', $request_query))
            ->getView();

        return $this->render('AnimeDbCatalogBundle:Notice:list.html.twig', [
            'list' => $list,
            'pagination' => $pagination,
            'change_form' => $this->createForm(new ChangeNotice())->createView(),
            'filter' => $filter->createView(),
            'action_remove' => ChangeNotice::ACTION_REMOVE,
        ]);
    }
538839
public function index(Request $request)
    {
        $query = $this->load()->query();

        /* Verificar como ira compilar...
        $except = isset($this->exceptAttributesIn['index']) ? $this->exceptAttributesIn['index'] : [];

        // Tratar attributes
        $result = [];
        foreach ($query->get() as $model) {
            $result[] = Arr::except($model->toArray(), $except);
        }*/

        return response()->json($query->get());
    }
438621
protected function getOffset(Request $request)
    {
        return max(
            $request->query->get('start', 0),
            $this->getDefaultOffset($request)
        );
    }
1263010
public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;

        if (!empty($keyword)) {
            $pages = Page::where('title', 'LIKE', "%$keyword%")
                ->orWhere('content', 'LIKE', "%$keyword%")
                ->latest()->paginate($perPage);
        } else {
            $pages = Page::latest()->paginate($perPage);
        }

        return view('admin.pages.index', compact('pages'));
    }
678987
public function indexAction(Request $request)
    {
        $language = $this->getLanguage($request);
        $webspace = $this->getWebspace($request);

        $result = $this->getRepository()->getIndexNode($webspace, $language);

        return $this->handleView($this->view($result));
    }
1169141
public function indexAction(Request $request)
    {
        $viewIndex = $this->get('phlexible_gui.view.index');

        return [
            'scripts' => $viewIndex->get($request),
            'noScript' => $viewIndex->getNoScript(),
        ];
    }
31943
public function indexAction(Request $request)
    {
        /* @var $response \Symfony\Component\HttpFoundation\Response */
        $response = $this->get('cache_time_keeper')->getResponse([], self::CACHE_LIFETIME);
        /* @var $widget \AnimeDb\Bundle\ShikimoriWidgetBundle\Service\Widget */
        $widget = $this->get('anime_db.shikimori.widget');

        $list = $this->get('anime_db.shikimori.browser')
            ->get(str_replace('#LIMIT#', self::LIST_LIMIT, self::PATH_NEW_ITEMS));
        $list = array_slice($list, 0, self::LIST_LIMIT); // see #2

        // add Etag from list items
        $response->setEtag($widget->hash($list));

        // response was not modified for this request
        if ($response->isNotModified($request) || !$list) {
            return $response;
        }

        // build list item entities
        foreach ($list as $key => $item) {
            $list[$key] = $widget->getWidgetItem($widget->getItem($item['id']));
        }

        return $this->render(
            'AnimeDbShikimoriNewItemsWidgetBundle:Widget:index.html.twig',
            ['items' => $list],
            $response
        );
    }
1339348
public function index(Request $request)
    {
        $limit = 20;

        $tags = $request->user()->tags()
            ->searchFilter($request->q)
            ->cursorFilter($request->cursor)
            ->orderBy(DB::raw('uuid_v1_timestamp(id)'), 'DESC')->limit($limit)->get();

        $results = fractal()
            ->collection($tags, new TagTransformer())
            ->withCursor(new Cursor($request->cursor, $request->prev, $tags, $limit));

        return $results;
    }
742656
public function sortAction(Request $request)
    {
        $tid = $request->get('tid');
        $mode = $request->get('mode');
        $dir = strtolower($request->get('dir'));
        $sortTids = $request->get('sort_ids');
        $sortTids = json_decode($sortTids, true);

        $treeManager = $this->get('phlexible_tree.tree_manager');
        $nodeSorter = $this->get('phlexible_tree.node_sorter');

        $tree = $treeManager->getByNodeId($tid);
        $node = $tree->get($tid);

        $node->setSortMode($mode);
        $node->setSortDir($dir);

        if ($mode !== TreeInterface::SORT_MODE_FREE) {
            $sortTids = $nodeSorter->sort($node);
        }

        if (count($sortTids)) {
            $tree->reorderChildren($node, $sortTids);
        }

        return new ResultResponse(true, 'Tree sort published.');
    }
458506
public function index(Request $request)
    {
        $jobs = $this->jobs->getRecent($request->query('starting_at', -1))->map(function ($job) {
            $job->payload = json_decode($job->payload);

            return $job;
        })->values();

        return [
            'jobs' => $jobs,
            'total' => $this->jobs->countRecent(),
        ];
    }