public function paginate($perPage = 15)
    {
        $paginator = Paginator::make($this->items, count($this->items), $perPage);

        $start = ($paginator->getFactory()->getCurrentPage() - 1) * $perPage;
        $sliced = array_slice($this->items, $start, $perPage);

        return Paginator::make($sliced, count($this->items), $perPage);
    }
public function paginate($perPage = 15)
    {
        $paginator = Paginator::make($this->items, count($this->items), $perPage);

        $start = ($paginator->getFactory()->getCurrentPage() - 1) * $perPage;
        $sliced = array_slice($this->items, $start, $perPage);

        return Paginator::make($sliced, count($this->items), $perPage);
    }
public function paginate ( $ perPage = 15 ) { $ paginator = Paginator :: make ( $ this -> items , count ( $ this -> items ) , $ perPage ) ; $ start = ( $ paginator -> getFactory ( ) -> getCurrentPage ( ) - 1 ) * $ perPage ; $ sliced = array_slice ( $ this -> items , $ start , $ perPage ) ; return Paginator :: make ( $ sliced , count ( $ this -> items ) , $ perPage ) ; }
Paginates the Elasticsearch results.

@param int $perPage
@return mixed
Paginates the Elasticsearch results .