PHPackages                             basemotive/phersist - 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. basemotive/phersist

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

basemotive/phersist
===================

A tiny PHP-ORM

v0.5.1(4w ago)087LGPL-2.1-or-laterPHPPHP &gt;=8.3.0

Since Mar 17Pushed 4w agoCompare

[ Source](https://github.com/basemotive/phersist)[ Packagist](https://packagist.org/packages/basemotive/phersist)[ Docs](https://phersist.dev/)[ RSS](/packages/basemotive-phersist/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (2)Versions (22)Used By (0)

PHersist
========

[](#phersist)

PHersist is a lightweight ORM (Object-Relational Mapper) for PHP.

This allows you to generate PHP model classes that are backed by database tables. You can create objects and work with them like normal, and them commit the changes to the database when you're done modifying them. PHersist handles the SQL for you.

Small but powerful
------------------

[](#small-but-powerful)

PHersist is designed to be minimalistic in the sense that its codebase is kept small, and it doesn't use any external libraries. It manages that while still offering robust mapping for objects, relations and maps.

Use an existing database schema, or create one
----------------------------------------------

[](#use-an-existing-database-schema-or-create-one)

You can make it work with most existing database schemas, as long as your tables are normalized. If you don't have an existing schema yet, you can generate one alongside your model classes.

Working with your model is easy
-------------------------------

[](#working-with-your-model-is-easy)

Creating new objects goes like this:

```
$user = new User();
$user->email = 'joe@example.org';
$user->password = password_hash('secret', PASSWORD_DEFAULT);
$user->name = 'Joe Example';
$user->commit();

echo "User created: {$user->name}\n";
```

And your new `User` is added to the database. Now if you need find that user later, it goes like this:

```
use PHersist\ObjectFinder;

$user = ObjectFinder::create(User::class)
	->where('email', '=', 'joe@example.org')
	->fetchOne();

echo "User retrieved: {$user->name}\n";
```

And you've retrieved the `User` you had previously created.

Getting started
---------------

[](#getting-started)

Read [the documentation](docs/index.md).

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Recently: every ~12 days

Total

21

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d13f5b959fe874c7c720ea37d0007591c97219522515e0540bf299236596cc29?d=identicon)[basemotive](/maintainers/basemotive)

---

Top Contributors

[![basemotive](https://avatars.githubusercontent.com/u/41019464?v=4)](https://github.com/basemotive "basemotive (49 commits)")

---

Tags

orm

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/basemotive-phersist/health.svg)

```
[![Health](https://phpackages.com/badges/basemotive-phersist/health.svg)](https://phpackages.com/packages/basemotive-phersist)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k295.3M7.2k](/packages/doctrine-orm)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k249.9M3.9k](/packages/doctrine-doctrine-bundle)[doctrine/persistence

The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.

4.0k298.2M962](/packages/doctrine-persistence)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k122.6M410](/packages/gedmo-doctrine-extensions)[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/packages/illuminate-database)[beberlei/doctrineextensions

A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.

2.1k78.1M168](/packages/beberlei-doctrineextensions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
