src/Fadion/Bouncy/ElasticCollection.php
/**
     * Paginates the Elasticsearch results.
     *
     * @param int $perPage
     * @return mixed
     */
Paginates the Elasticsearch results.
@param int $perPage
@return mixed
Paginates the Elasticsearch results . @param int $perPage @return mixed
public function paginate($perPage = 15)
    {
        $page   = Paginator::resolveCurrentPage() ?: 1;
        $path   = URL::to('/').'/'.\Request::path();
        $sliced = array_slice($this->items, ($page - 1) * $perPage, $perPage);
        $total  = count($this->items);
        return new LengthAwarePaginator($sliced, $total, $perPage, $page, compact('path'));
    }
public function paginate ( $ perPage = 15 ) { $ page = Paginator :: resolveCurrentPage ( ) ? : 1 ; $ path = URL :: to ( '/' ) . '/' . \ Request :: path ( ) ; $ sliced = array_slice ( $ this -> items , ( $ page - 1 ) * $ perPage , $ perPage ) ; $ total = count ( $ this -> items ) ; return new LengthAwarePaginator ( $ sliced , $ total , $ perPage , $ page , compact ( 'path' ) ) ; }
Paginates the Elasticsearch results.
Paginates the Elasticsearch results .