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

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

artisanbr/generic-model
=======================

An Laravel eloquent-like model class, for Laravel and other frameworks, based and inspired in jenssegers/model

v2.0.1(2y ago)050MITPHP

Since Mar 23Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

Laravel Generic Models
======================

[](#laravel-generic-models)

Este pacote provê a criação de Models Genéricas baseadas na estrutura do Eloquent do Laravel com melhorias e adaptações do pacote **jenssegers/model**.

Instalação
==========

[](#instalação)

```

composer require artisanbr/generic-model

```

Versões
=======

[](#versões)

Tabela de Versões
-----------------

[](#tabela-de-versões)

Laravel VersionPackage Version9 &amp; 10v1.0.011v2.0.0Features e Adaptações
---------------------

[](#features-e-adaptações)

- Accessors e mutators
- Conversão de Model para Array e JSON
- Hidden attributes nas conversões para Array/JSON
- Guarded e fillable attributes
- Appends accessors e mutators nas conversões para Array/JSON
- Casting de Attributes

Você pode saber mais sobre os recursos originais do Eloquent Model em

Exemplo
-------

[](#exemplo)

```
use Model\GenericModel;

class User extends GenericModel {

    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"}
```

Baseado e Adaptado de

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

Every ~2 days

Total

3

Last Release

781d ago

Major Versions

v1.0.0 → v2.0.02024-03-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/feda388a105b69bc587b6be19c0a67991180ed21fec891c2d717ddceac448099?d=identicon)[artisanbr](/maintainers/artisanbr)

---

Top Contributors

[![renalcio](https://avatars.githubusercontent.com/u/7205767?v=4)](https://github.com/renalcio "renalcio (56 commits)")

---

Tags

laravelmodelphpphplaravelmodeleloquent

### Embed Badge

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

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[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)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[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)

PHPackages © 2026

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