PHPackages                             esensi/model - 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. esensi/model

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

esensi/model
============

The base model traits of Esensi

v4.1.0(10mo ago)20266.5k↓50%25[2 issues](https://github.com/esensi/model/issues)1MITPHPPHP ^8.2

Since Jun 26Pushed 10mo ago24 watchersCompare

[ Source](https://github.com/esensi/model)[ Packagist](https://packagist.org/packages/esensi/model)[ RSS](/packages/esensi-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (49)Used By (1)

Esensi Model Traits Package
---------------------------

[](#esensi-model-traits-package)

> Version 1

An [Esensi](https://github.com/esensi) package, coded by [SiteRocket Labs®](https://www.siterocket.com).

The `Esensi/Model` package is just one package that makes up [Esensi](https://github.com/esensi), a platform built on [Laravel](https://laravel.com). This package uses [PHP traits](https://culttt.com/2014/06/25/php-traits) to extend Laravel's default Eloquent models and traits. Using traits allows for a high-degree of code reusability and extensibility. While this package provides some reasonable base models, developers are free to mix and match traits in any combination needed, being confident that the code complies to a reliable interface and is properly unit tested. For more details on the inner workings of the traits please consult the generously documented source code.

Note
----

[](#note)

This code is specifically designed to be compatible with the [Laravel Framework](https://laravel.com) and may not be compatible as a stand-alone dependency or as part of another framework.

### Extend the Default Model

[](#extend-the-default-model)

The simplest way to demonstrate the traits is to extend the base [`Esensi\Model\Model`](https://github.com/esensi/model/blob/master/src/Model.php). For example, if the application requires a simple blog, then the developer could create a `Post` model that **automatically handles validation, purging, hashing, encrypting, attribute type juggling and even simplified relationship bindings** by simply extending this ready-to-go model:

```
