src/Http/Controllers/TeamResourceController.php
public function index(TeamRequest $request)
    {
        $view = $this->response->theme->listView();

        if ($this->response->typeIs('json')) {
            $function = camel_case('get-' . $view);
            return $this->repository
                ->setPresenter(\Litecms\Team\Repositories\Presenter\TeamPresenter::class)
                ->$function();
        }

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

        return $this->response->title(trans('team::team.names'))
            ->view('team::team.index', true)
            ->data(compact('teams'))
            ->output();
    }
public function index(TeamRequest $request)
    {
        $view = $this->response->theme->listView();

        if ($this->response->typeIs('json')) {
            $function = camel_case('get-' . $view);
            return $this->repository
                ->setPresenter(\Litecms\Team\Repositories\Presenter\TeamPresenter::class)
                ->$function();
        }

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

        return $this->response->title(trans('team::team.names'))
            ->view('team::team.index', true)
            ->data(compact('teams'))
            ->output();
    }
public function index ( TeamRequest $ request ) { $ view = $ this -> response -> theme -> listView ( ) ; if ( $ this -> response -> typeIs ( 'json' ) ) { $ function = camel_case ( 'get-' . $ view ) ; return $ this -> repository -> setPresenter ( \ Litecms \ Team \ Repositories \ Presenter \ TeamPresenter :: class ) -> $ function ( ) ; } $ teams = $ this -> repository -> paginate ( ) ; return $ this -> response -> title ( trans ( 'team::team.names' ) ) -> view ( 'team::team.index' , true ) -> data ( compact ( 'teams' ) ) -> output ( ) ; }
Display a list of team.

@return Response
Display a list of team .