public function paginateWith($loaders, $constraints = [], $paginate = [])
    {
        $categories = $this->getModel()->with($loaders);

        if (count($constraints) > 0) {
            $categories->where($constraints);
        }

        return $this->paginate($categories, $paginate);
    }
public function paginateWith($loaders, $constraints = [], $paginate = [])
    {
        $categories = $this->getModel()->with($loaders);

        if (count($constraints) > 0) {
            $categories->where($constraints);
        }

        return $this->paginate($categories, $paginate);
    }
public function paginateWith ( $ loaders , $ constraints = [ ] , $ paginate = [ ] ) { $ categories = $ this -> getModel ( ) -> with ( $ loaders ) ; if ( count ( $ constraints ) > 0 ) { $ categories -> where ( $ constraints ) ; } return $ this -> paginate ( $ categories , $ paginate ) ; }
Paginates the given query and load relationship.

@param  string|array $loaders
@param  array $constraints
@param  array $paginate

@return LengthAwarePaginator
Paginates the given query and load relationship .