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

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

timolake/model
==============

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

1.0.0(3y ago)08MITPHP

Since Mar 1Pushed 3y agoCompare

[ Source](https://github.com/timolake/model)[ Packagist](https://packagist.org/packages/timolake/model)[ Docs](https://github.com/jenssegers/model)[ RSS](/packages/timolake-model/feed)WikiDiscussions master Synced today

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

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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

1219d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5251569?v=4)[timolake](/maintainers/timolake)[@timolake](https://github.com/timolake)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (78 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)")[![timolake](https://avatars.githubusercontent.com/u/5251569?v=4)](https://github.com/timolake "timolake (2 commits)")[![thinkstylestudio](https://avatars.githubusercontent.com/u/322368?v=4)](https://github.com/thinkstylestudio "thinkstylestudio (2 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)")[![julesjanssen](https://avatars.githubusercontent.com/u/492036?v=4)](https://github.com/julesjanssen "julesjanssen (1 commits)")

---

Tags

laravelmodeleloquent

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M95](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)

PHPackages © 2026

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