public function paginate($perPage, $page = null)
    {
        if (empty($page)) {
            $page = request('page', 1);
        }
        $offset = ($page * $perPage) - $perPage;

        $collection = $this->all();
        $newItems = array_slice($collection, $offset, $perPage, true);
        return $this->createChildCollection($newItems);
    }
public function paginate($perPage, $page = null)
    {
        if (empty($page)) {
            $page = request('page', 1);
        }
        $offset = ($page * $perPage) - $perPage;

        $collection = $this->all();
        $newItems = array_slice($collection, $offset, $perPage, true);
        return $this->createChildCollection($newItems);
    }
public function paginate ( $ perPage , $ page = null ) { if ( empty ( $ page ) ) { $ page = request ( 'page' , 1 ) ; } $ offset = ( $ page * $ perPage ) - $ perPage ; $ collection = $ this -> all ( ) ; $ newItems = array_slice ( $ collection , $ offset , $ perPage , true ) ; return $ this -> createChildCollection ( $ newItems ) ; }
Paginate collection items
@param int $perPage
@param int $page
@return \LiteFrame\Collection
Paginate collection items