PHPackages                             ornament/core - 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. ornament/core

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

ornament/core
=============

PHP8 ORM toolkit, core package

0.17.1(4mo ago)0615[1 PRs](https://github.com/ornament-orm/core/pulls)4MITPHPPHP &gt;=8.1

Since Aug 24Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ornament-orm/core)[ Packagist](https://packagist.org/packages/ornament/core)[ RSS](/packages/ornament-core/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (85)Used By (4)

Ornament
========

[](#ornament)

PHP8 object decorator toolkit, core package

When translating data from any storage source to your PHP models, you'll often want to *augment* it. For example, a date from a database is simply a string, but maybe you prefer it as a `DateTime` object, or a `Carbon` instance.

Ornament's aim is to simplify tons of boilerplate code to facilitate this.

Installation
------------

[](#installation)

```
$ composer require ornament/core
```

You'll likely also want auxiliary packages from the `ornament/*` family. These contain predefined types you can use, e.g. the `Bitflag\Property` allowing you to stuff multiple `true/false` values in a single integer.

### Manual installation

[](#manual-installation)

Yadiyadi, `git clone` or whatever and add the path for the `Ornament\Core`namespace to your `psr-4` autoload config. But really, don't do that unless you're masochistic.

Basic usage
-----------

[](#basic-usage)

Ornament models are nothing more than vanilla PHP classes; there is no need to extend any master or god class of sorts (you might want to do that in your own framework of choice).

At the very least, you'll want to `use` the `Ornament\Core\Model` trait:

```
