> For the complete documentation index, see [llms.txt](https://jls-organization-3.gitbook.io/projecthyper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jls-organization-3.gitbook.io/projecthyper/features/quickstart/paginate.md).

# paginate

An essential function for auto pagination of the record.

**Usage:**

```php
$db->{table}->paginate($pagination);
```

**Example:**

Basic Pagination

```php
$paginate = array(
    'page' => 1,
    'limit' => 10
);
$news = $db->news->paginate($paginate);
```

Pagination with where conditions

```php
$paginate = array(
    'page' => 1,
    'limit' => 10,
    'where' => array('name' => 'My Test')
);
$news = $db->news->paginate($paginate);
```

Returns:

```json
[
    {
        "id": "1",
        "name": "Test News",
        "status": "ACTIVE",
        "created_at": "2024-11-03 21:07:37",
        "updated_at": null,
        "deleted_at": null
    },
    ...
]
```

Looking for the other parameters?

{% content-ref url="/pages/GBigEuwxBTtPN353H08f" %}
[Parameters](/projecthyper/features/quickstart/parameters.md)
{% endcontent-ref %}
