Return pages.

@return \Illuminate\Http\Resources\Json\AnonymousResourceCollection|\Illuminate\Http\JsonResponse
493577
public function index()
    {
        $entries = WinkPage::when(request()->has('search'), function ($q) {
            $q->where('title', 'LIKE', '%'.request('search').'%');
        })
            ->orderBy('created_at', 'DESC')
            ->paginate(30);

        return PagesResource::collection($entries);
    }
397578
public function list()
    {
        $response = $this->client->fetch(
            $this->uri,
            []
        );

        return json_encode($response->getContent(), JSON_FORCE_OBJECT);
    }
391670
protected function getJsonDocumentList()
    {
        if (!isset($this->config['library'])) {
            return json_encode(static::$apiResponseBody, JSON_PRETTY_PRINT);
        }

        if (!count($this->config['library'])) {
            return json_encode(static::$apiResponseBody, JSON_PRETTY_PRINT);
        }

        foreach (array_keys($this->config['library']) as $document) {
            static::$apiResponseBody['data'][] = [
                'document' => $document,
                'link' => Router::url([
                    'plugin' => 'Alt3/Swagger',
                    'controller' => 'Docs',
                    'action' => 'index',
                    $document
                ], true)
            ];
        }

        return json_encode(static::$apiResponseBody, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
    }
1331981
public function getInformation(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
1093774
public function getPages(){
        // Set method and action
        $method = 'settings';
        $action = 'getPages';

        // Set data
        $data = array(array(1)); // At least one parameter is required by API

        // Send request and retrieve response
        $result = Dispatcher::send($method, $action, $data);

        return $result;
    }
1243042
public function actionPageviews()
	{
		$models = Events::model()->groupByUrl()->findAll();
		$response = array();

		foreach ($models as $model)
			$response[] = array(
				'uri' => $model->uri,
				'count' => $model->id
			);

		return $response;
	}
436629
public function getList()
    {
        $response = $this->getResponse();
        $configurationHandler = $this->getConfigurationHandler();
        $configuration = $configurationHandler->getConfiguration();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $adapter = new Json();
        $response->setContent($adapter->serialize($configuration));
        return $response;
    }
432359
public function getPagesAsOptions()
    {
        $pages = [];
        $publishedPages = $this->repo->all();

        foreach ($publishedPages as $page) {
            $pages[$page->title] = $page->id;
        }

        return $pages;
    }
1358098
public function getRelatedPages()
    {
        $pages = ArrayList::create();

        foreach ($this->Sets() as $documentSet) {
            /** @var DocumentSet $documentSet */
            $pages->add($documentSet->Page());
        }
        $pages->removeDuplicates();

        $this->extend('updateRelatedPages', $pages);

        return $pages;
    }
963729
public function getRootPages(): array
    {
        return $this->connection->createQueryBuilder()
            ->select('language', 'id', 'fallback')
            ->from('tl_page')
            ->where('type=:type')
            ->setParameter('type', 'root')
            ->orderBy('fallback')
            ->addOrderBy('sorting')
            ->execute()
            ->fetchAll(\PDO::FETCH_ASSOC);
    }
905058
public function getPagesRoutes()
    {
        $qb = $this->createQueryBuilder('p');

        $results = $qb
            ->select('p.route')
            ->getQuery()
            ->getScalarResult();

        return array_column($results, 'route');
    }
1344151
public function getList()
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		// 1) getting params
		$page = (int) $this->params()->fromQuery("page", 1);
		$category = $this->params()->fromQuery("category", "usato");
		$purpose = $this->params()->fromQuery("purpose", "compravendita");
		$location = $this->params()->fromQuery("location", "italia");
		$limit = 30;
		$offset = ($page * $limit) - $limit;
		$returnSelect = true;
		
		// 2) Discard useless params and prepare them to be passed to the model
		$params = $this->requestToSearchParams($this->params()->fromQuery());
		$params = is_array($params) ? $params + compact('returnSelect', 'offset', 'limit') : array();
		
		if(empty($params)) {
            return new JsonModel(array());
		}
		
		// 3) get only for current user?
		$onlyCurrentUser = (bool) $this->params()->fromQuery("current", false);
		$k = 0;
		foreach($params['field'] as $f) {
			if('current' == $f || 'user' == $f) {
				unset($params['field'][$k]);
				unset($params['value'][$k]);
			}
			$k++;
		}
		if($onlyCurrentUser) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
				$identity = $this->zfcUserAuthentication()->getIdentity();
// 				$params['field'][] = 'user';
// 				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
				$params['field'][] = 'account';
				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
			} else {
				// Questo è necessario per non far restituire la lista completa se l'utente non è connesso
				$params['field'][] = 'account';
				$params['value'][] = sha1('usernotconnected');
			}
		}
		
		// 4) all classifieds? This should be requested only by the admin, will not use sphinx
		if((bool) $this->params()->fromQuery("full", false)) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
			    $params = $this->params()->fromQuery();
				$identity = $this->zfcUserAuthentication()->getIdentity();
				$userModel = $this->getServiceLocator()->get('user.model.user');
				$userModel->init($identity, $this->getServiceLocator());
				if(!$userModel->getIsAdmin()) {
				    return new JsonModel(array());
				}
				
				$paginator = $this->getServiceLocator()->get('document.paginator.classifiedFull');
				$paginator->build($params);

				$data = array();
				foreach($paginator as $post) {
            		$file = $this->getServiceLocator()->get('document.model.classifiedAdminListing');
				    $data[] = $file->init($post);
				}

				$routeName = 'DocumentAdminClassified/page';
				$routeParams = array('page' => $this->params()->fromQuery("page", 1));
				$queryParams = array('full' => 1, 'user' => $this->params()->fromQuery("user"));
				$data = $this->getModel()->getPaginationData($this->getServiceLocator(), $paginator, $data, $routeName, $routeParams, $queryParams);

				return new JsonModel($data);
			}
		}
		
		// 5) Pass param to the model and get the data
		$data = $this->getModel()->getList($params, $this->getServiceLocator());
		
		return new JsonModel($data);
	}
676172
public function ajaxGetVisits()
    {
        $data = Base::getVisitsRepository()->orderBy('created_at', 'desc')->take(300)->get(['url', 'browser', 'ip', 'created_at', 'country']);

        return \Response::json(array('data' => $data));
    }
902613
public function pages()
    {
        $links[] = [__d('me_cms', 'List pages'), [
            'controller' => 'Pages',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins and managers can access these actions
        if ($this->Auth->isGroup(['admin', 'manager'])) {
            $links[] = [__d('me_cms', 'Add page'), [
                'controller' => 'Pages',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'List categories'), [
                'controller' => 'PagesCategories',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add category'), [
                'controller' => 'PagesCategories',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        $links[] = [__d('me_cms', 'List static pages'), [
            'controller' => 'Pages',
            'action' => 'indexStatics',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        return [$links, I18N_PAGES, ['icon' => 'far copy']];
    }
412777
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllCollections(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllCollections();
        }
    }
203020
public function index()
    {
        $list = $this->repo->allPaged();

        if ( ! $list)
        {
            return $this->respondNotFound('Unable to fetch the selected resource');
        }

        $resource = new Fractal\Resource\Collection($list->getCollection(), new $this->transformerClass);
        $resource->setPaginator(new Fractal\Pagination\IlluminatePaginatorAdapter($list));

        return $this->fractal->createData($resource)->toArray();
//        return $this->response->collection($list, new $this->transformerClass);
    }
1351841
public function getChildren()
        {
            $hash = key($this->_index);

            if (isset($this->_pages[$hash])) {
                return $this->_pages[$hash];
            }

            return null;
        }