PHPackages                             aliengen/pachyderm-orm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. aliengen/pachyderm-orm

ActiveLibrary[Database &amp; ORM](/categories/database)

aliengen/pachyderm-orm
======================

A micro ORM for Pachyderm

01.5k↓81.3%2[1 PRs](https://github.com/AlienGen/pachyderm-orm/pulls)PHP

Since May 10Pushed 3w ago3 watchersCompare

[ Source](https://github.com/AlienGen/pachyderm-orm)[ Packagist](https://packagist.org/packages/aliengen/pachyderm-orm)[ RSS](/packages/aliengen-pachyderm-orm/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Pachyderm ORM
-------------

[](#pachyderm-orm)

A lightweight ORM for the [Pachyderm](https://github.com/AlienGen/Pachyderm) micro-framework.

- **Models** — map tables to PHP classes
- **Fluent queries** — filter, join, order, paginate
- **BelongsTo relations** — load related rows with a LEFT JOIN
- **Collections** — iterable results with a total count
- **Mass assignment guards** — optional `$fillable` / `$guarded`

---

### Table of Contents

[](#table-of-contents)

- [Installation](#installation)
- [Quick start](#quick-start)
- [Querying](#querying)
    - [Nested groups with QueryBuilder](#nested-groups-with-querybuilder)
    - [EXISTS, subqueries, and aggregates](#exists-subqueries-and-aggregates)
- [Relations](#relations)
    - [BelongsTo](#belongsto)
    - [Serializing relations to arrays (optional)](#serializing-relations-to-arrays-optional)
- [Table inheritance (optional)](#table-inheritance-optional)
- [Scopes](#scopes)
- [Pagination helper](#pagination-helper)
- [Mass assignment](#mass-assignment)
- [CRUD routes](#crud-routes)
- [Testing](#testing)
- [Troubleshooting](#troubleshooting)
- [Custom DB engine](#custom-db-engine)
- [License](#license)

---

### Installation

[](#installation)

```
composer require aliengen/pachyderm-orm
```

---

### Quick start

[](#quick-start)

#### 1) Declare a model

[](#1-declare-a-model)

```
