public function getByPage(
        int $page = 1,
        int $limit = 10,
        array $where = [],
        array $with = [],
        string $orderBy = null,
        string $order = 'desc'
    ) {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        if ($orderBy) {
            $query = $query->orderBy($orderBy, $order);
        }

        return $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
    }
public function getByPage(
        int $page = 1,
        int $limit = 10,
        array $where = [],
        array $with = [],
        string $orderBy = null,
        string $order = 'desc'
    ) {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        if ($orderBy) {
            $query = $query->orderBy($orderBy, $order);
        }

        return $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
    }
public function getByPage ( int $ page = 1 , int $ limit = 10 , array $ where = [ ] , array $ with = [ ] , string $ orderBy = null , string $ order = 'desc' ) { $ query = $ this -> make ( $ with ) ; $ query = $ this -> applyWhere ( $ query , $ where ) ; if ( $ orderBy ) { $ query = $ query -> orderBy ( $ orderBy , $ order ) ; } return $ query -> skip ( $ limit * ( $ page - 1 ) ) -> take ( $ limit ) -> get ( ) ; }
Get ordered results by Page.

@param int $page
@param int $limit
@param array $where
@param array $with
@param string|null $orderBy
@param string $order

@return Collection
Get ordered results by Page .