Display a listing of the resource.

@return \Illuminate\Http\JsonResponse
195217
public function index()
    {
        $this->authorize('read', Option::class);
        return $this->respondWithSuccess($this->optionRepo->getCategories(), new OptionCategoryTransformer);
    }
1083101
public function listAction()
    {
        $filterManager = $this->get('phlexible_message.filter_manager');

        $filters = [];

        foreach ($filterManager->findBy(['userId' => $this->getUser()->getId()]) as $filter) {
            $criteria = [];
            foreach ($filter->getCriteria() as $groupIndex => $group) {
                foreach ($group as $criterium) {
                    $criteria[] = [
                        'criteria' => $criterium->getType(),
                        'value' => $criterium->getValue(),
                        'group' => $groupIndex + 1,
                    ];
                }
            }

            $filters[] = [
                'id' => $filter->getId(),
                'title' => $filter->getTitle(),
                'criteria' => $criteria,
            ];
        }

        return new JsonResponse($filters);
    }
1045559
public function index()
    {
        $query = $this->Posts->find()->contain([
            'Categories' => ['fields' => ['id', 'title']],
            'Tags' => function (Query $q) {
                return $q->order(['tag' => 'ASC']);
            },
            'Users' => ['fields' => ['id', 'first_name', 'last_name']],
        ]);

        $this->paginate['order'] = ['created' => 'DESC'];

        $posts = $this->paginate($this->Posts->queryFromFilter($query, $this->request->getQueryParams()));

        $this->set(compact('posts'));
    }
733551
public function index()
	{
		$posts = $this->posts->active(100);

		$data = array(
			'posts'   => $posts,
			'updated' => isset($posts[0]) ? $posts[0]->atom_date : date('Y-m-d H:i:s'),
		);

		return Response::view($this->theme.'.atom', $data, 200, array(
			'Content-Type' => 'application/rss+xml; charset=UTF-8',
		));
	}
386694
public function View ()
	{
		
		// If the view is JSON
		
		if ($this->view instanceof \Sonic\View\JSON)
		{
			
			// Display view

			$response = $this->view->display ();
			
		}
		
		// Else call parent method
		
		else
		{
			parent::View ();
		}
		
	}
329916
public function listAction()
    {
        /** @var FeatureTypeService $featureService */
        $featureService = $this->container->get("features");
        $featureTypes   = $featureService->getFeatureTypeDeclarations();

        return new JsonResponse(array(
            'list' => $featureTypes,
        ));
    }
218633
public function listAction(Request $request)
    {
        $this->checkAccess('LIST', null);
        $resources = $this->getResourceManager()->findAll();
        $view = $this->view($resources, \FOS\RestBundle\Util\Codes::HTTP_OK);
        return $this->handleView($view);
    }
59883
public function listJsonAction() {
        //Get the folder
        $folderUri = $this->container->get('request')->query->get('id');

        //Set folder uri to null to use the default if the root is requested ('#')
        if ('#' === $folderUri) {
            $folder = null;
        } else {
            $folder = $folderUri;
        }

        //Get the resource descriptors (not recursively)
        $resources = $this->container->get('mesd.jasper.report.client')->getResourceList($folder, false);

        //Convert the resources into an array to encode in json in the way jstree can read them
        $response = array();
        foreach($resources as $resource) {
            $data = array();
            $data['id'] = $resource->getUriString();
            $data['parent'] = $folderUri;
            $data['icon'] = false;

            if ('reportUnit' === $resource->getWsType()) {
                //Report object specific settings
                $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-file"></i> ' . $resource->getLabel();
                $data['children'] = false;
                //Set the href to the report input form
                $data['a_attr'] = array('href' => $this->container->get('router')->generate('MesdJasperReportViewerBundle_display_report_viewer', array('reportUri' => rawurlencode($resource->getUriString()))));
                $data['dump'] = $resource->getUriString();
            } elseif ('folder' === $resource->getWsType()) {
                //Folder object specific settings
                $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-folder-close"></i> ' . $resource->getLabel();
                $data['children'] = true;
            }

            $response[] = $data;
        }

        //Get the resources
        return new JsonResponse($response);
    }
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));
    }
423827
public function index()
    {
        return $this->render('index', [
            'model' => $this->model,
            'endpoints' => $this->getAvailableApiEndpoints(),
            'groupsCount' => $this->model->getGroups()->count(),
        ]);
    }
154154
public function index()
    {
        // Look for overriden views
        $this->overrideViews();

        // Get models to show
        $results = $this->makeIndexQuery()->paginate($this->perPage());

        // Render the view using the `listing` builder
        $listing = Listing::createFromController($this, $results);
        if ($this->parent) {
            $listing->parent($this->parent);

            // The layout header may have a many to many autocomplete
            $this->layout->with($this->autocompleteViewVars());
        }

        // Render view
        return $this->populateView($listing);
    }
776015
public function render()
    {
        $this->controllerContext->getResponse()->setHeader('Content-Type', 'application/json');
        $propertiesToRender = $this->renderArray();
        $options = $this->getOption('jsonEncodingOptions');
        return json_encode($propertiesToRender, $options);
    }
980161
public function index()
    {
        $request = $this->makeRequest('index');
        $result = $this->service->getAll();

        return $this->maybeMakeResource('collection', $result);
    }
1268212
public function index()
    {
        return view('address.list', [
            'addresses' => $addresses = Auth::user()->addresses,
            'defaultId' => $addresses->where('default', true)->pluck('id')->first(),
        ]);
    }
945762
public function index()
    {
        $categories = $this->repository->all();
        $categoryGrid = new CategoryDataGrid($this->repository->query());

        return view('avored-framework::product.category.index')
            ->with('dataGrid', $categoryGrid->dataGrid)
            ->with('categories', $categories);
    }
703925
public function actionIndex()
    {
        $result = [
            'content' => false,
            'response' => 'error',
        ];

        $params = Json::decode(Craft::$app->request->getRawBody());
        $config = $params['params'] ?? [];
        $uri = $params['uri'];

        if (($uri ?? false)) {
            $config['includeAssets'] = false;

            $result['content'] = AdminBar::$plugin->bar->renderAdminBarForUri($uri, $config);
            if (!empty($result['content'])) {
                $result['response'] = 'success';
            }
        }

        return $this->asJson($result);
    }
209772
public function view()
    {
        $response = [
            'success' => false,
            'data' => [],
            'errors' => []
        ];

        if ($this->request->is(['post', 'patch', 'put'])) {
            $data = $this->request->getData();
            $result = $this->CalendarEvents->getEventInfo($data['id']);

            if (!empty($result)) {
                $response['success'] = true;
                $response['data'] = $result;
            } else {
                $response['errors'][] = "Couldn't find Event with id {$data['id']}";
            }
        }

        $this->set(compact('response'));
        $this->set('_serialize', 'response');
    }