PHPackages                             riverside/php-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. riverside/php-orm

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

riverside/php-orm
=================

PHP ORM micro-library and query builder

2.0.0(1y ago)111.2k↓50%2[2 issues](https://github.com/riverside/php-orm/issues)MITPHPPHP &gt;=7.1CI failing

Since Oct 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/riverside/php-orm)[ Packagist](https://packagist.org/packages/riverside/php-orm)[ Docs](https://github.com/riverside/php-orm)[ Fund](https://www.paypal.me/Dimitar81)[ RSS](/packages/riverside-php-orm/feed)WikiDiscussions main Synced 1mo ago

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

php-orm
=======

[](#php-orm)

PHP micro-ORM and query builder.

BuildGitHub pagesStableLicense[![CI](https://github.com/riverside/php-orm/actions/workflows/test.yml/badge.svg)](https://github.com/riverside/php-orm/actions/workflows/test.yml)[![pages-build-deployment](https://github.com/riverside/php-orm/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/riverside/php-orm/actions/workflows/pages/pages-build-deployment)[![Latest Stable Version](https://camo.githubusercontent.com/59b14758a8ad58834e42e97f918c1f5d06bcd676370cebcebab7e2082a76791d/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d6f726d2f762f737461626c65)](https://packagist.org/packages/riverside/php-orm)[![License](https://camo.githubusercontent.com/5e5469377e75cbc77551dcc2c7501b6bae7f2ec92d3ab78f87811042aac4851d/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d6f726d2f6c6963656e7365)](https://packagist.org/packages/riverside/php-orm)### Requirements

[](#requirements)

- PHP &gt;= 7.1
- PHP extensions:
    - PDO (`ext-pdo`)

### Installation

[](#installation)

If Composer is not installed on your system yet, you may go ahead and install it using this command line:

```
$ curl -sS https://getcomposer.org/installer | php

```

Next, add the following require entry to the `composer.json` file in the root of your project.

```
{
    "require" : {
        "riverside/php-orm" : "^2.0"
    }
}
```

Finally, use Composer to install php-orm and its dependencies:

```
$ php composer.phar install

```

### Configuration

[](#configuration)

Include autoload in your project:

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

Configure database credentials by setting up the following environment variables: `USERNAME`, `PASSWORD`, `DATABASE`, `HOST`, `PORT`, `DRIVER`, `CHARSET`, `COLLATION`. They must be prefixed with `$connection` property value, part of your model, in capital letters and underscore. The default value of `$connection`property is 'default'. For example:

```
