original_string: public function index(PortfolioRequest $request)
      {
          $view = $this->response->theme->listView();
  
          if ($this->response->typeIs('json')) {
              $function = camel_case('get-' . $view);
              return $this->repository
                  ->setPresenter(\Litecms\Portfolio\Repositories\Presenter\PortfolioPresenter::class)
                  ->$function();
          }
  
          $portfolios = $this->repository->paginate();
  
          return $this->response->title(trans('portfolio::portfolio.names'))
              ->view('portfolio::portfolio.index', true)
              ->data(compact('portfolios'))
              ->output();
      }
code: public function index(PortfolioRequest $request)
      {
          $view = $this->response->theme->listView();
  
          if ($this->response->typeIs('json')) {
              $function = camel_case('get-' . $view);
              return $this->repository
                  ->setPresenter(\Litecms\Portfolio\Repositories\Presenter\PortfolioPresenter::class)
                  ->$function();
          }
  
          $portfolios = $this->repository->paginate();
  
          return $this->response->title(trans('portfolio::portfolio.names'))
              ->view('portfolio::portfolio.index', true)
              ->data(compact('portfolios'))
              ->output();
      }
code_tokens: public function index ( PortfolioRequest $ request ) { $ view = $ this -> response -> theme -> listView ( ) ; if ( $ this -> response -> typeIs ( 'json' ) ) { $ function = camel_case ( 'get-' . $ view ) ; return $ this -> repository -> setPresenter ( \ Litecms \ Portfolio \ Repositories \ Presenter \ PortfolioPresenter :: class ) -> $ function ( ) ; } $ portfolios = $ this -> repository -> paginate ( ) ; return $ this -> response -> title ( trans ( 'portfolio::portfolio.names' ) ) -> view ( 'portfolio::portfolio.index' , true ) -> data ( compact ( 'portfolios' ) ) -> output ( ) ; }
docstring: Display a list of portfolio.
  
  @return Response
docstring_tokens: Display a list of portfolio .