public function index(ContactRequest $request)
    {

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

        $contacts = $this->repository->paginate();
        
        $this->response->theme->asset()->container('footer')->add('gmap', 'https://maps.googleapis.com/maps/api/js?key=' . config('litecms.contact.gmapapi'));

        return $this->response->setMetaTitle(trans('contact::contact.names'))
            ->view('contact::contact.index', true)
            ->data(compact('contacts'))
            ->output();
    }
public function index(ContactRequest $request)
    {

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

        $contacts = $this->repository->paginate();
        
        $this->response->theme->asset()->container('footer')->add('gmap', 'https://maps.googleapis.com/maps/api/js?key=' . config('litecms.contact.gmapapi'));

        return $this->response->setMetaTitle(trans('contact::contact.names'))
            ->view('contact::contact.index', true)
            ->data(compact('contacts'))
            ->output();
    }
public function index ( ContactRequest $ request ) { if ( $ this -> response -> typeIs ( 'json' ) ) { $ pageLimit = $ request -> input ( 'pageLimit' ) ; $ data = $ this -> repository -> setPresenter ( \ Litecms \ Contact \ Repositories \ Presenter \ ContactListPresenter :: class ) -> getDataTable ( $ pageLimit ) ; return $ this -> response -> data ( $ data ) -> output ( ) ; } $ contacts = $ this -> repository -> paginate ( ) ; $ this -> response -> theme -> asset ( ) -> container ( 'footer' ) -> add ( 'gmap' , 'https://maps.googleapis.com/maps/api/js?key=' . config ( 'litecms.contact.gmapapi' ) ) ; return $ this -> response -> setMetaTitle ( trans ( 'contact::contact.names' ) ) -> view ( 'contact::contact.index' , true ) -> data ( compact ( 'contacts' ) ) -> output ( ) ; }
Display a list of contact.

@return Response
Display a list of contact .