src/Query.php
public function paginate($per_page = 10, $page_name = "page", $page = null)
    {

        $this->take($per_page);

        $page = $page ?: Request::get($page_name, 1);

        $this->skip(($page * $per_page) - $per_page);

        $objects = $this->get();

        return new Pagination($objects, $objects->total, $per_page, $page, ['path' => Request::url(), 'query' => Request::query()]);
    }
public function paginate($per_page = 10, $page_name = "page", $page = null)
    {

        $this->take($per_page);

        $page = $page ?: Request::get($page_name, 1);

        $this->skip(($page * $per_page) - $per_page);

        $objects = $this->get();

        return new Pagination($objects, $objects->total, $per_page, $page, ['path' => Request::url(), 'query' => Request::query()]);
    }
public function paginate ( $ per_page = 10 , $ page_name = "page" , $ page = null ) { $ this -> take ( $ per_page ) ; $ page = $ page ? : Request :: get ( $ page_name , 1 ) ; $ this -> skip ( ( $ page * $ per_page ) - $ per_page ) ; $ objects = $ this -> get ( ) ; return new Pagination ( $ objects , $ objects -> total , $ per_page , $ page , [ 'path' => Request :: url ( ) , 'query' => Request :: query ( ) ] ) ; }
Paginate collection of results
@param int $per_page
@param      $page_name
@param null $page
@return Pagination
Paginate collection of results