Display a listing of the resource.

@param $type
@param Request $request
@return Response
402
public function index($type, Request $request)
    {
        try {
            $resultColumns = [];
            $query = $request->get('q');
            $column = $request->get('c');

            $model = app()->make(config('mentions.' . $type));

            $records = $model->where($column, 'LIKE', "%$query%")
                             ->get([$column]);

            foreach ($records as $record) {
                $resultColumns[] = $record->$column;
            }

            return response()->json($resultColumns);
        } catch (\ReflectionException $e) {
            return response()->json('Not Found', 404);
        }
    }
707149
public function index($type = 'list')
    {
        $this->updateNavType($type);

        $itemsHtml = $this->getNavigationHtml($this->defaultParent);

        return $this->view('titan::pages.order', compact('itemsHtml'));
    }
409517
public function indexAction(Request $request)
    {
        $dispatcher = $this->get('event_dispatcher');
        $event = new ResponseEvent($request);
        $dispatcher->dispatch(OpiferMediaEvents::MEDIA_CONTROLLER_INDEX, $event);

        if (null !== $event->getResponse()) {
            return $event->getResponse();
        }

        $providers = $this->get('opifer.media.provider.pool')->getProviders();

        return $this->render($this->container->getParameter('opifer_media.media_index_view'), [
            'providers' => $providers,
        ]);
    }
916029
private function parseJsonResponseBody(Request $request, Response $response, $type)
    {
        // Find resource type (URL) in response location or request url
        $location = $response->hasHeader('Location')
            ? $this->createUri($response->getHeaderLine('Location'))
            : $request->getUri();

        $uri = urldecode($location->getPath());

        // Remove version from URI
        $uri = preg_replace('#^/' . self::CURRENT_VERSION . '#', '', $uri);

        // Unserialize response body
        $content = json_decode((string) $response->getBody(), true) ?: [];

        // Build expected resource
        $resource = $this->factory->create($uri, []);

        if ($resource instanceof Rest\Collection) {
            $content = [
                'data' => $content,
                '_metadata' => [
                    'uri' => $uri,
                    'limit' => (int) $response->getHeaderLine('Pagination-Limit'),
                    'offset' => (int) $response->getHeaderLine('Pagination-Offset'),
                    'total' => (int) $response->getHeaderLine('Pagination-Total'),
                ],
            ];
        } else {
            $content['_metadata'] = [
                'uri' => $uri,
            ];
        }

        $resource->populate($content);

        return $resource;
    }
930971
public function listAction(Request $request)
    {
        $mediaTypeManager = $this->get('phlexible_media_type.media_type_manager');
        $iconResolver = $this->get('phlexible_media_type.icon_resolver');

        $mediaTypes = [];
        foreach ($mediaTypeManager->findAll() as $mediaType) {
            $mediaTypes[] = [
                'id' => $mediaType->getName(),
                'key' => $mediaType->getName(),
                'upperkey' => strtoupper($mediaType->getName()),
                'type' => $mediaType->getCategory(),
                'de' => $mediaType->getTitle('de'),
                'en' => $mediaType->getTitle('en'),
                'mimetypes' => $mediaType->getMimetypes(),
                'icon16' => (bool) $iconResolver->resolve($mediaType, 16),
                'icon32' => (bool) $iconResolver->resolve($mediaType, 32),
                'icon48' => (bool) $iconResolver->resolve($mediaType, 48),
                'icon256' => (bool) $iconResolver->resolve($mediaType, 256),
            ];
        }

        return new JsonResponse([
            'totalCount' => count($mediaTypes),
            'mediatypes' => $mediaTypes,
        ]);
    }
854990
public function displayTypeProperty(Request $request)
    {
        if (!$request->isXmlHttpRequest()) {
            $this->app->abort(400);
        }

        $records = RecordsRequest::fromRequest($this->app, $request, false, [\ACL::CANMODIFRECORD]);

        $recordsType = [];

        foreach ($records as $record) {
            //perform logic
            $sbasId = $record->getDataboxId();

            if (!isset($recordsType[$sbasId])) {
                $recordsType[$sbasId] = [];
            }

            if (!isset($recordsType[$sbasId][$record->getType()])) {
                $recordsType[$sbasId][$record->getType()] = [];
            }

            $recordsType[$sbasId][$record->getType()][] = $record;
        }

        return new Response($this->render('prod/actions/Property/type.html.twig', [
            'records'     => $records,
            'recordsType' => $recordsType,
        ]));
    }
796907
public function index(Request $request)
    {
        $rows = $this->noticiaRepo->findAndPaginate($request);
        $categorias = $this->categoriaRepo->listPub();

        return view('admin.noticias.list', compact('rows','categorias'));
    }
942339
public function listAction(Request $request)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_READ);

        /** @var GridConfigurator $gridConfigurator */
        $gridConfigurator = $configuratorFactory->getConfigurator(GridConfigurator::class);
        /* @var PageConfigurator $pageConfigurator */
        $pageConfigurator = $configuratorFactory->getConfigurator(PageConfigurator::class);

        $translator = $this->get('translator');
        $translationDomain = $this->getParameter('symfonyid.admin.translation_domain');

        $template = $crudConfigurator->getTemplate();
        $listTemplate = $request->isXmlHttpRequest() ? $template->getAjaxTemplate() : $template->getList();

        $reflectionModel = new \ReflectionClass($crudConfigurator->getCrud()->getModelClass());
        $filters = $gridConfigurator->getFilters($reflectionModel);

        /** @var View $view */
        $view = $this->get('symfonyid.admin.view.view');
        $view->setParam('page_title', $translator->trans($pageConfigurator->getTitle(), array(), $translationDomain));
        $view->setParam('page_description', $translator->trans($pageConfigurator->getDescription(), array(), $translationDomain));

        /*
         * Translate tentity fields
         */
        $view->setParam('filter_fields', implode(', ', array_map(function ($value) use ($translator, $translationDomain) {
            return $translator->trans(sprintf('entity.fields.%s', $value), array(), $translationDomain);
        }, $filters)));
        $view->setParam('filter_fields_entity', implode(', ', $filters));

        return $this->doList($request, $crudConfigurator, $view, $gridConfigurator->getColumns($reflectionModel), $listTemplate, $gridConfigurator->getGrid()->isFormatNumber());
    }
619910
public function index(Request $request)
    {
        $this->getFormRequestInstance();

        $items = $this->getItemsCollection();

        if ($request->wantsJson()) {
            return $this->validSuccessJsonResponse('Success', $items);
        }

        $view = $this->getViewLocation(__FUNCTION__);
        $this->checkViewExists($view);

        return response()->view($view, compact('items'));
    }
1148767
public function create($type, Request $request)
    {
        if ($type && $product = $this->productManager->findByNamespace($type)) {
            $categories = $this->category->all()->nest()->listsFlattened('name');
            $shops = $this->shop->all();
            $optionTypes = $this->optionManager->all();

            return view('product::admin.products.create', compact('product', 'categories', 'shops', 'optionTypes'));
        }

        // If type is not exists, default type will be set
        $first = $this->productManager->first();

        return redirect()->route($request->route()->getName(), ['type' => $first->getEntityNamespace()]);
    }
75338
public function index(Request $request)
    {
        // GET THE SLUG, ex. 'posts', 'pages', etc.
        $slug = $this->getSlug($request);

        // GET THE DataType based on the slug
        $dataType = Admin::model('DataType')->where('slug', '=', $slug)->first();

        // Check permission
        $this->authorize('browse', app($dataType->model_name));

        if ($dataType->pagination === 'ajax') {
            return $this->indexAjax($request);
        }

        $getter = $dataType->pagination === 'php' ? 'paginate' : 'get';

        $search = (object) ['value' => $request->get('s'), 'key' => $request->get('key'), 'filter' => $request->get('filter')];
        $searchable = $dataType->pagination === 'php' ? array_keys(SchemaManager::describeTable(app($dataType->model_name)->getTable())->toArray()) : '';
        $orderBy = $request->get('order_by');
        $sortOrder = $request->get('sort_order', null);

        // Next Get or Paginate the actual content from the MODEL that corresponds to the slug DataType
        if (strlen($dataType->model_name) != 0) {
            $model = app($dataType->model_name);

            $query = $model;

            if (method_exists($model, 'adminList')) {
                $query = $model->adminList();
            }

            $query->select('*');

            $relationships = $this->getRelationships($dataType);

            // If a column has a relationship associated with it, we do not want to show that field
            $this->removeRelationshipField($dataType, 'browse');

            if ($search->value && $search->key && $search->filter) {
                $search_filter = ($search->filter == 'equals') ? '=' : 'LIKE';
                $search_value = ($search->filter == 'equals') ? $search->value : '%'.$search->value.'%';
                $query = $query->where($search->key, $search_filter, $search_value);
            }

            if ($orderBy && in_array($orderBy, $dataType->fields())) {
                $querySortOrder = (!empty($sortOrder)) ? $sortOrder : 'DESC';
                $dataTypeContent = call_user_func([
                    $query = $query->with($relationships)->orderBy($orderBy, $querySortOrder),
                    $getter,
                ]);
            } elseif ($model->timestamps) {
                $dataTypeContent = call_user_func([$query->latest($model::CREATED_AT), $getter]);
            } else {
                $dataTypeContent = call_user_func([$query->with($relationships)->orderBy($model->getKeyName(), 'DESC'), $getter]);
            }

            // Replace relationships' keys for labels and create READ links if a slug is provided.
            $dataTypeContent = $this->resolveRelations($dataTypeContent, $dataType);
        } else {
            // If Model doesn't exist, get data from table name
            $dataTypeContent = call_user_func([DB::table($dataType->name), $getter]);
            $model = false;
        }

        // Check if CRUD is Translatable
        if (($isModelTranslatable = is_crud_translatable($model))) {
            $dataTypeContent->load('translations');
        }

        // Check if server side pagination is enabled
        $isServerSide = $dataType->isServerSide();

        $view = 'admin::crud.browse';

        if (view()->exists("admin::$slug.browse")) {
            $view = "admin::$slug.browse";
        }

        return Admin::view($view, compact(
            'dataType',
            'dataTypeContent',
            'isModelTranslatable',
            'search',
            'orderBy',
            'sortOrder',
            'searchable',
            'isServerSide'
        ));
    }
1180385
public function index(Request $request)
    {
        $categories = $this->repository->allOrSearch($request->get('q'));

        $no = $categories->firstItem();

        return $this->view('categories.index', compact('categories', 'no'));
    }
987930
public function listAction(Request $request)
    {
        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, ContentTypeInterface::ENTITY_TYPE);
        $mapping = array(
            'name' => 'names',
            'content_type_id' => 'contentTypeId',
            'linked_to_site' => 'linkedToSite'
        );
        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
        $repository = $this->get('open_orchestra_model.repository.content_type');

        $collection = $repository->findAllNotDeletedInLastVersionForPaginate($configuration);
        $recordsTotal = $repository->countByContentTypeInLastVersion();
        $recordsFiltered = $repository->countNotDeletedInLastVersionWithSearchFilter($configuration);
        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('content_type_collection', $collection);
        $facade->recordsTotal = $recordsTotal;
        $facade->recordsFiltered = $recordsFiltered;

        return $facade;
    }
1283598
public function listAction(Request $request): Response
    {
        $page = $request->query->get('page') ?? 1;

        $pagerfanta = new Pagerfanta(
            new ArrayAdapter($this->languageService->loadLanguages())
        );

        $pagerfanta->setMaxPerPage($this->defaultPaginationLimit);
        $pagerfanta->setCurrentPage(min($page, $pagerfanta->getNbPages()));

        /** @var Language[] $languageList */
        $languageList = $pagerfanta->getCurrentPageResults();

        $deleteLanguagesForm = $this->formFactory->deleteLanguages(
            new LanguagesDeleteData($this->getLanguagesNumbers($languageList))
        );

        return $this->render('@ezdesign/admin/language/list.html.twig', [
            'pager' => $pagerfanta,
            'form_languages_delete' => $deleteLanguagesForm->createView(),
            /* @deprecated since version 2.2, to be removed in 3.0. Use 'can_administrate' instead. */
            'canEdit' => $this->isGranted(new Attribute('content', 'translations')),
            /* @deprecated since version 2.2, to be removed in 3.0. Use 'can_administrate' instead. */
            'canAssign' => $this->isGranted(new Attribute('content', 'translations')),
            'can_administrate' => $this->isGranted(new Attribute('content', 'translations')),
        ]);
    }
416921
public function listActionCustom(Request $request = null)
    {
        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

        return $this->renderWithExtraParams($this->admin->getTemplate('list'), [
            'action' => 'list',
            'form' => $formView,
            'batch_action_forms' => $this->getBatchActionFormViews(),

            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->admin->getExportFormats(),
        ], null);
    }
1266001
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
	{
		$response = $this->app->handle($request, $type, $catch);

		foreach ($this->cookies->getQueuedCookies() as $cookie)
		{
			$response->headers->setCookie($cookie);
		}

		return $response;
	}
244194
public function listTableAction(Request $request)
    {
        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, StatusInterface::ENTITY_TYPE);
        $mapping = array(
            'label' => 'labels'
        );
        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
        $repository = $this->get('open_orchestra_model.repository.status');
        $collection = $repository->findForPaginate($configuration);
        $recordsTotal = $repository->countNotOutOfWorkflow();
        $recordsFiltered = $repository->countWithFilter($configuration);
        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('status_collection', $collection);
        $facade->recordsTotal = $recordsTotal;
        $facade->recordsFiltered = $recordsFiltered;

        return $facade;
    }