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

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

joshcadman01/jenssegers-model
=============================

An Laravel eloquent-like model class, for Laravel and other frameworks

1.0.0(2y ago)09MITPHP

Since Apr 2Pushed 2y agoCompare

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

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

Model
=====

[](#model)

[![Build Status](https://camo.githubusercontent.com/5ffd3701ddf8110c28dca5a6f5ece2b50fa4875115a2480482badb258ac2cd92/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a656e737365676572732f6d6f64656c2e737667)](https://travis-ci.org/jenssegers/model) [![Coverage Status](https://camo.githubusercontent.com/38943c58ae83fbf54def4cde8739e54ee8c6a1992005895ae52f58b3c49e571a/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a656e737365676572732f6d6f64656c2e737667)](https://coveralls.io/r/jenssegers/model)

This model provides an Laravel eloquent-like base class that can be used to build custom models in Laravel or other frameworks.

Features
--------

[](#features)

- Accessors and mutators
- Model to Array and JSON conversion
- Hidden attributes in Array/JSON conversion
- Guarded and fillable attributes
- Appending accessors and mutators to Array/JSON conversion
- Attribute casting

You can read more about these features and the original Eloquent model on

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

[](#installation)

Install using composer:

```
composer require jenssegers/model
```

Example
-------

[](#example)

```
use Jenssegers\Model\Model;

class User extends Model {

    protected $hidden = ['password'];

    protected $guarded = ['password'];

    protected $casts = ['age' => 'integer'];

    public function save()
    {
        return API::post('/items', $this->attributes);
    }

    public function setBirthdayAttribute($value)
    {
        $this->attributes['birthday'] = strtotime($value);
    }

    public function getBirthdayAttribute($value)
    {
        return new DateTime("@$value");
    }

    public function getAgeAttribute($value)
    {
        return $this->birthday->diff(new DateTime('now'))->y;
    }
}

$item = new User(array('name' => 'john'));
$item->password = 'bar';

echo $item; // {"name":"john"}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.6% 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

Unknown

Total

1

Last Release

770d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bd2021089bd5bfd420e2c5927142b80eb88f91ff0a5eab83ad7888c1bbf21de?d=identicon)[joshcadman01](/maintainers/joshcadman01)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (80 commits)")[![Smolevich](https://avatars.githubusercontent.com/u/7188867?v=4)](https://github.com/Smolevich "Smolevich (31 commits)")[![mikebronner](https://avatars.githubusercontent.com/u/1791050?v=4)](https://github.com/mikebronner "mikebronner (10 commits)")[![mauro-moreno](https://avatars.githubusercontent.com/u/1187170?v=4)](https://github.com/mauro-moreno "mauro-moreno (6 commits)")[![joshcadman01](https://avatars.githubusercontent.com/u/135721885?v=4)](https://github.com/joshcadman01 "joshcadman01 (3 commits)")[![thinkstylestudio](https://avatars.githubusercontent.com/u/322368?v=4)](https://github.com/thinkstylestudio "thinkstylestudio (2 commits)")[![Kyzegs](https://avatars.githubusercontent.com/u/45851377?v=4)](https://github.com/Kyzegs "Kyzegs (2 commits)")[![julesjanssen](https://avatars.githubusercontent.com/u/492036?v=4)](https://github.com/julesjanssen "julesjanssen (1 commits)")[![jimmyaldape](https://avatars.githubusercontent.com/u/59585840?v=4)](https://github.com/jimmyaldape "jimmyaldape (1 commits)")[![mtdavidson](https://avatars.githubusercontent.com/u/201792?v=4)](https://github.com/mtdavidson "mtdavidson (1 commits)")[![DariusIII](https://avatars.githubusercontent.com/u/3399658?v=4)](https://github.com/DariusIII "DariusIII (1 commits)")[![aglipanci](https://avatars.githubusercontent.com/u/2675283?v=4)](https://github.com/aglipanci "aglipanci (1 commits)")

---

Tags

laravelmodeleloquent

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joshcadman01-jenssegers-model/health.svg)

```
[![Health](https://phpackages.com/badges/joshcadman01-jenssegers-model/health.svg)](https://phpackages.com/packages/joshcadman01-jenssegers-model)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)

PHPackages © 2026

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