PHPackages                             vundi/potato-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. vundi/potato-orm

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

vundi/potato-orm
================

An ORM package that allows you to perform basic CRUD operations on any database

1.0.5(10y ago)31131MITPHPPHP &gt;=5.6

Since Feb 11Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/andela-cvundi/potatoORM)[ Packagist](https://packagist.org/packages/vundi/potato-orm)[ Docs](https://github.com/andela-cvundi/potatoORM)[ RSS](/packages/vundi-potato-orm/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (10)Used By (0)

POTATO ORM
==========

[](#potato-orm)

[![Build Status](https://camo.githubusercontent.com/11494279fef97ca0929bfe139e8f6f806d69d2bc3fc4cb6de1f8e6968e1b4c8a/68747470733a2f2f7472617669732d63692e6f72672f616e64656c612d6376756e64692f706f7461746f4f524d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andela-cvundi/potatoORM)[![Coverage Status](https://camo.githubusercontent.com/55a12b4da5fe1e7dfb0b4baba6872c664649af00602f5c108462f4ca167bb85f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e64656c612d6376756e64692f706f7461746f4f524d2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/andela-cvundi/potatoORM?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/02566f0316b01098ec78405b54df0e395950484f230f1ff6611ae8ebf3e39f5c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64656c612d6376756e64692f706f7461746f4f524d2f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f706d656e74)](https://scrutinizer-ci.com/g/andela-cvundi/potatoORM/?branch=development)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

POTATO ORM is a custom ORM that allows you to perform all CRUD operations on a table when working with any database

Install
-------

[](#install)

Installation via Composer

```
$ composer require vundi/potato-orm
```

Usage
-----

[](#usage)

#### Configuration SQL databases

[](#configuration-sql-databases)

**NOTE:** Load you connection variables from the `.env` file in the root folder. If you do not have a `.env` file in your root folder or don't know about it, please read this [phpdotenv project](https://github.com/vlucas/phpdotenv).

Provide `Database host`, `database user`, `database password` and the `type` in the .env file. Once you provide the right values a Database connection will be established.

```
// Load the `.env` variables for the project
// Check the `.env.example` file in the root of the project to see the environment variables needed.
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
```

Once we have a connection, we create a model class which extends Model. Inside the model class set the entity table name

```
require 'vendor/autoload.php';

use Vundi\Potato\Model;
use Vundi\Potato\Exceptions\NonExistentID;
use Vundi\Potato\Exceptions\IDShouldBeNumber;

class User extends Model
{
	protected static $entity_table = 'Person';
}
```

Database interactions

```
// create a new user
$user = new User;
$user->name = "Kevin Karugu";
$user->age = 23;
$user->company = "Microsoft";
$user->save();
```

Get all users from the users table

```
$users = User::findAll(); // Returns an array of the users found in the db
```

Get a single user from the users table

```
$user = User::find(2); // will return user with an ID of 2
```

Edit an existing user

```
$user = User::find(2);
$user->name = "Devy Kerr";
$user->company = "Suyabay";
$user->update();
```

Delete a user

```
//Will remove a user from the database table
User::remove(2); // 2 represents the id of the user to be removed
```

Credits
-------

[](#credits)

- [Christopher Vundi](https://github.com/andela-cvundi)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance55

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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 ~4 days

Total

6

Last Release

3771d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8840187?v=4)[Christopher Vundi](/maintainers/vickris)[@vickris](https://github.com/vickris)

---

Top Contributors

[![vickris](https://avatars.githubusercontent.com/u/8840187?v=4)](https://github.com/vickris "vickris (69 commits)")[![guss77](https://avatars.githubusercontent.com/u/381782?v=4)](https://github.com/guss77 "guss77 (9 commits)")

---

Tags

databaseormpdocrud

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vundi-potato-orm/health.svg)

```
[![Health](https://phpackages.com/badges/vundi-potato-orm/health.svg)](https://phpackages.com/packages/vundi-potato-orm)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[bephp/activerecord

micro activerecord library in PHP(only 400 lines with comments), support chain calls and relations(HAS\_ONE, HAS\_MANY, BELONGS\_TO).

1162.1k2](/packages/bephp-activerecord)[flightphp/active-record

Micro Active Record library in PHP, support chain calls, events, and relations.

163.6k11](/packages/flightphp-active-record)

PHPackages © 2026

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