src/Http/Controllers/BlockResourceController.php
public function index(BlockRequest $request)
    {

        if ($this->response->typeIs('json')) {
            $pageLimit = $request->input('pageLimit');
            $data      = $this->repository
                ->setPresenter(\Litecms\Block\Repositories\Presenter\BlockListPresenter::class)
                ->getDataTable($pageLimit);
            return $this->response
                ->data($data)
                ->output();
        }

        $blocks = $this->repository->paginate();

        return $this->response->setMetaTitle(trans('block::block.names'))
            ->view('block::admin.block.index')
            ->data(compact('blocks'))
            ->output();
    }
public function index(BlockRequest $request)
    {

        if ($this->response->typeIs('json')) {
            $pageLimit = $request->input('pageLimit');
            $data      = $this->repository
                ->setPresenter(\Litecms\Block\Repositories\Presenter\BlockListPresenter::class)
                ->getDataTable($pageLimit);
            return $this->response
                ->data($data)
                ->output();
        }

        $blocks = $this->repository->paginate();

        return $this->response->setMetaTitle(trans('block::block.names'))
            ->view('block::admin.block.index')
            ->data(compact('blocks'))
            ->output();
    }
public function index ( BlockRequest $ request ) { if ( $ this -> response -> typeIs ( 'json' ) ) { $ pageLimit = $ request -> input ( 'pageLimit' ) ; $ data = $ this -> repository -> setPresenter ( \ Litecms \ Block \ Repositories \ Presenter \ BlockListPresenter :: class ) -> getDataTable ( $ pageLimit ) ; return $ this -> response -> data ( $ data ) -> output ( ) ; } $ blocks = $ this -> repository -> paginate ( ) ; return $ this -> response -> setMetaTitle ( trans ( 'block::block.names' ) ) -> view ( 'block::admin.block.index' ) -> data ( compact ( 'blocks' ) ) -> output ( ) ; }
Display a list of block.

@return Response
Display a list of block .