Rinvex\Repository\Repositories\EloquentRepository::paginate PHP Method

paginate() public method

Paginate all entities.
public paginate ( integer | null $perPage = null, array $attributes = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer | null
$attributes array
$pageName string
$page integer | null
return Illuminate\Contracts\Pagination\LengthAwarePaginator
    public function paginate($perPage = null, $attributes = ['*'], $pageName = 'page', $page = null)
    {
        $page = $page ?: Paginator::resolveCurrentPage($pageName);
        return $this->executeCallback(get_called_class(), __FUNCTION__, array_merge(func_get_args(), compact('page')), function () use($perPage, $attributes, $pageName, $page) {
            return $this->prepareQuery($this->createModel())->paginate($perPage, $attributes, $pageName, $page);
        });
    }