Display a listing of the resource.

@param Request $request

@return \Illuminate\Http\Response
556905
public function index(Request $request)
    {
        $limit = 20;

        $sources = $request->user()->sources()
            ->orderBy('id', 'DESC')->limit($limit)->get();

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

        return $results;
    }
204695
public function index(Request $request)
    {
        $notifications = $this->service->paginated();
        return view('admin.notifications.index')->with('notifications', $notifications);
    }
289031
public function indexAction(Request $request)
    {
        /** @var TranslationManager $manager */
        $manager = $this->get('ongr_translations.translation_manager');

        return $this->render(
            'ONGRTranslationsBundle:List:list.html.twig',
            [
                'locales' => $this->getParameter('ongr_translations.locales'),
                'tags' => $manager->getTags(),
                'domains' => $manager->getDomains(),
            ]
        );
    }
210959
public function index(Request $request)
    {
        $this->validate($request, ['category_id' => ['required']]);

        $threads = $this->model()
            ->withRequestScopes($request)
            ->where('category_id', $request->input('category_id'))
            ->get();

        return $this->response($threads);
    }
1125177
public function index(Request $request)
    {
        $spammers = $this->paginate($this->blocker->all(), $request, $this->perPage);

        $this->setTitle($title = trans('seo::spammers.titles.spammers-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.spammers.index', compact('spammers'));
    }
1004266
public function listAction(Request $request): Response
    {
        $data = new URLListData();

        $form = $this->formFactory->createUrlListForm($data, '', [
            'method' => Request::METHOD_GET,
            'csrf_protection' => false,
        ]);
        $form->handleRequest($request);
        if ($form->isSubmitted() && !$form->isValid()) {
            throw new BadRequestHttpException();
        }

        $urls = new Pagerfanta(new URLSearchAdapter(
            $this->buildListQuery($data),
            $this->urlService
        ));

        $urls->setCurrentPage($data->page);
        $urls->setMaxPerPage($data->limit ? $data->limit : self::DEFAULT_MAX_PER_PAGE);

        return $this->render('@ezdesign/link_manager/list.html.twig', [
            'form' => $form->createView(),
            'can_edit' => $this->isGranted(new Attribute('url', 'update')),
            'urls' => $urls,
        ]);
    }
1003458
public function listAction(Request $request)
    {
        $query = $this->addOrganizationFilter($request->query->all());

        return new JsonResponse($this->finder->search(
            $this->getClass(),
            $query,
            []
        ));
    }
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,
        ]);
    }
624849
public function listAction(Request $request)
    {
        $dataGrid = $this->getDataGrid();

        $this->bindDataGridRequest($dataGrid, $request);

        return $this->renderAction(
            array_merge(
                $this->getViewParameters($request),
                ['datagrid' => $dataGrid]
            )
        );
    }
948968
public function index(Request $request)
    {
        // handle permission
//        list($request, $filters) = $this->handlePermission(__FUNCTION__, $request);

        // create response model
        $response = new ResponseModel();

        $pageSize = $this->DEFAULT_RESULT_PER_PAGE;

        $pageNumber = 1;

        //set default pagination

        //set page size
        if (!isset($request->toArray()['page']['size'])) {
            $pageSize = $this->DEFAULT_RESULT_PER_PAGE;
        } elseif (($request->get('page')['size']) == 0) {
            $pageSize = $this->DEFAULT_RESULT_PER_PAGE;
        } else {
            $pageSize = $request->get('page')['size'];
        }

        //set page number
        if (!isset($request->get('page')['number'])) {
            $pageNumber = $this->DEFAULT_PAGE_NUMBER;
        } elseif (($request->get('page')['number']) == 0) {
            $pageNumber = $this->DEFAULT_PAGE_NUMBER;
        } else {
            $pageNumber = $request->get('page')['number'];
        }
        $request['page'] = $pageNumber;


        //set default ordering
        if (isset($request->toArray()['order_by'])) {
            if (is_null($request['order_by'])) {
                $request['order_by'] = "{\"field\":\"id\",\"operator\":\"Desc\"}";
            }
        }

        $validationErrors = $this->checkRequestValidation($request, $this->indexValidateArray);
        if ($validationErrors != null) {
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($validationErrors->toArray()));
            }
            $response->setMessage($this->getTrans(__FUNCTION__, 'validation_failed'));
            $response->setStatus(false);
            $response->setError(99);
            return SmartResponse::response($response);
        }

        try {
            $data = $request->get('query') != null ?
                $this->model
                    ->whereKey(collect($this->model
                        ->search(($request->get('query')))
                        ->raw())->get('ids')) :
                $this->model;

            if (array_key_exists('file', $request->toArray())) {
                //TODO add relation on top if here and create a tree flatter array in array helper
                //return (new ExcelHelper())->setOptions([
                //    'store_format' => $request->get('file') == null ? 'xls' : $request->get('file'),
                //    'download_format' => $request->get('file') == null ? 'xls' : $request->get('file'),
                //])->table($data->get()->toArray())->createExcelFile()->download();
            }

            // load relations
            if (count($this->indexLoad) > 0) {
                $data = $data->with($this->indexLoad);
            }

            // filters by
            if (!is_null($request->get('filters'))) {
                $data = (new QueryHelper())->deepFilter($data, (new RequestHelper())->getCollectFromJson($request['filters']));
            }

            // order by
            if (!is_null($request->get('order_by'))) {
                $data = (new QueryHelper())->orderBy($data, (new RequestHelper())->getCollectFromJson($request['order_by']));
            }

            // return response
            $response->setData(collect($data->paginate($pageSize)));
            $response->setMessage($this->getTrans('index', 'successful'));
            return SmartResponse::response($response);

        } catch (QueryException $exception) {

            // return response
            $response->setData(collect($exception->getMessage()));
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('index', 'failed'));
            $response->setStatus(false);
            return SmartResponse::response($response);
        }
    }
671136
public function search(Request $request)
    {
        $features = $this->service->search($request->search, null);
        return view('admin.features.index')->with('features', $features);
    }
882654
public function browseAction(Request $request)
    {
        $response = $this->convertResourceToPlainText(
            $request->getRequestFormat('xml'),
            $this->mapper->getCollection()
        );

        return new Response($response);
    }
850893
public function listAction(Request $request)
    {
        $start = $request->get('start', 0);
        $limit = $request->get('limit', 25);
        $sort = $request->get('sort');
        $dir = $request->get('dir');
        $tid = $request->get('tid');
        $language = $request->get('language');
        $filterValues = $request->get('filter');
        if ($filterValues) {
            $filterValues = json_decode($filterValues, true);
        } else {
            $filterValues = [];
        }

        $treeManager = $this->get('phlexible_tree.tree_manager');
        $elementService = $this->get('phlexible_element.element_service');
        $iconResolver = $this->get('phlexible_element.icon_resolver');
        $tokenStorage = $this->get('security.token_storage');
        $nodePermissionResolver = $this->get('phlexible_tree.node_permission_resolver');

        $tree = $treeManager->getByNodeID($tid);
        $node = $tree->get($tid);
        $eid = $node->getTypeId();
        $element = $elementService->findElement($eid);
        $elementMasterLanguage = $element->getMasterLanguage();
        $elementVersion = $elementService->findLatestElementVersion($element);
        $elementtype = $elementService->findElementtype($element);
        //$elementData = $element->getData(0, 'en');
        $token = $tokenStorage->getToken();

        if (!$language) {
            $language = $elementMasterLanguage;
        }

        $userRights = $nodePermissionResolver->resolve($node, $language, $token);

        if ($userRights === null) {
            throw $this->createAccessDeniedException();
        }

        $parent = [
            'tid' => (int) $tid,
            'teaser_id' => (int) 0,
            'eid' => (int) $eid,
            'title' => $elementVersion->getBackendTitle($language, $elementMasterLanguage),
            'element_type_id' => $elementtype->getId(),
            'element_type' => $elementtype->getTitle(),
            'icon' => $iconResolver->resolveTreeNode($node, $language),
            'author' => 'author',
            'version' => $elementVersion->getVersion(),
            'create_time' => $elementVersion->getCreatedAt()->format('Y-m-d H:i:s'),
            'publish_time' => $node->getTree()->getPublishedAt($node, $language) ? $node->getTree()->getPublishedAt($node, $language)->format('Y-m-d H:i:s') : null,
            'custom_date' => $elementVersion->getCustomDate($language) ? $elementVersion->getCustomDate($language)->format('Y-m-d H:i:s') : null,
            'language' => $language,
            'sort' => 0,
            'sort_mode' => $node->getSortMode(),
            'sort_dir' => $node->getSortDir(),
            'version_latest' => 1, //(int) $node->getLatestVersion(),
            'version_online' => 2, //(int) $node->getOnlineVersion($language),
            'status' => ' o_O ',
            'rights' => $userRights,
            'qtip' => $elementtype->getTitle().', Version '.$elementtype->getRevision().'<br>'.
                'Version '.$elementVersion->getVersion().'<br>'.
                37 .' Versions<br>',
        ];

        $filter = new TreeFilter(
            $this->get('doctrine.dbal.default_connection'),
            $request->getSession(),
            $this->get('event_dispatcher'),
            $node->getId(),
            $language
        );

        $filter
            ->setFilterValues($filterValues)
            ->setSortMode($sort)
            ->setSortDir($dir);

        $childIds = $filter->getIds($limit, $start);
        $cnt = $filter->getCount();

        $data = [];
        foreach ($childIds as $childId => $latestVersion) {
            $childNode = $tree->get($childId);

            $userRights = $nodePermissionResolver->resolve($childNode, $language, $token);
            if ($userRights === null) {
                continue;
            }

            $childElement = $elementService->findElement($childNode->getTypeId());
            $childElementVersion = $elementService->findLatestElementVersion($childElement);
            $childTitle = $childElementVersion->getBackendTitle($language, $childElement->getMasterLanguage());
            $childElementtype = $elementService->findElementtype($childElement);

            $data[] = [
                'tid' => (int) $childNode->getId(),
                'eid' => (int) $childElement->getEid(),
                '_type' => 'element',
                'title' => $childTitle,
                'element_type_id' => $childElementtype->getId(),
                'element_type' => $childElementtype->getTitle(),
                'navigation' => 0, //$childNode->inNavigation($childElementVersion->getVersion()),
                'restricted' => 0, //$childNode->isRestricted($childElementVersion->getVersion()),
                'icon' => $iconResolver->resolveTreeNode($childNode, $language),
                'author' => 'author',
                'version' => $childElementVersion->getVersion(),
                'create_time' => $childNode->getCreatedAt()->format('Y-m-d H:i:s'),
                // 'change_time'     => $child['modify_time'],
                'publish_time' => $childNode->getTree()->getPublishedAt($childNode, $language) ? $node->getTree()->getPublishedAt($childNode, $language)->format('Y-m-d H:i:s') : null,
                'custom_date' => $childElementVersion->getCustomDate($language) ? $childElementVersion->getCustomDate($language)->format('Y-m-d H:i:s') : null,
                'language' => $language,
                'sort' => (int) $childNode->getSort(),
                'version_latest' => 1, //(int) $childNode->getLatestVersion(),
                'version_online' => 2, //(int) $childNode->getOnlineVersion($language),
                'status' => '>o>',
                'rights' => $userRights,
                'qtip' => $childElementtype->getTitle().', '.
                    'ET Version '.$childElementtype->getRevision().'<br>'.
                    'Version '.$childElementVersion->getVersion().'<br>',
            ];
        }

        //$data['totalChilds'] = $element->getChildCount();

        return new JsonResponse([
            'parent' => $parent,
            'list' => $data,
            'total' => $cnt,
        ]);
    }
1193222
public function listAction(Request $request)
    {
        return new JsonResponse(
            $this->finder->search(
                'UJM\ExoBundle\Entity\Item\Item',
                $request->query->all(),
                [Transfer::INCLUDE_SOLUTIONS, Transfer::INCLUDE_ADMIN_META]
            )
        );
    }
394655
public function show(Request $request)
    {
        $post = $this->api('post.fetch', $request->route('post'))->parameters(['with' => ['thread', 'thread.category', 'parent']])->get();

        event(new UserViewingPost($post));

        $thread = $post->thread;
        $category = $thread->category;

        return view('forum::post.show', compact('category', 'thread', 'post'));
    }
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'));
    }
246276
public function index(Request $request)
    {
        $logs = $this->service->get($request->all());
        $levels = $this->service->levels;
        $dates = $this->service->getLogDates();

        return view('admin.logs.index')
            ->with('dates', $dates)
            ->with('logs', $logs)
            ->with('levels', $levels);
    }