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

ActiveLibrary

maxkut/model-entities
=====================

wrapper for json objects

v0.3.0(6y ago)019MITPHPPHP ^7.2CI failing

Since Feb 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/max-kut/model-entities)[ Packagist](https://packagist.org/packages/maxkut/model-entities)[ RSS](/packages/maxkut-model-entities/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

\#PHP обертка над `json`-данными

Служит для более управляемой и документированной работы с данными json-полей моделей или ответов различных API

\###Установка `composer require maxkut/model-entities`

\###Концепция Библиотека включает два абстрактных класса `\Entities\Entity` и `\Entities\EntityCollection `, которые содержат вспомогательные методы для типизации свойств конечных объектов. Очень важно документировать свойства создаваемых классов. Так Вы не забудете, какие свойства есть у того или иного объекта. В примере ниже задокументированы свойства класса Settings в PhpDoc. Плюс Ваша ide будет вам помогать с подсказками.

\###Пример

```
// Как пример сложных json полей модели App\Models\User
namespace App\Models\Entities\User;
use Entities\Entity;
/**
 * Class Settings
 * @property bool $property1
 * @property int $property2
 * @property array $property3
 */
class Settings extends Entity
{
    /**
     * @var bool $strictParams - если true,
     * то любые свойства, которые не объявлены в $attributes, $casts
 или для него нет акцессора/мутатора
     * вызовут исключение Entities\Exceptions\NotDefinedPropertyException
     */
    public $strictParams = true;

    protected $attributes = [
        'property1' => null,
        'property2' => null,
        'property3' => null,
    ];

    protected $casts = [
        'property1' => 'bool',
        'property2' => 'int',
        'property3' => 'array',
    ];
}

///////////////////////////////////////////
/// На примере моделей Eloquent ORM
/// надо создать методы преобразования (акцессор и мутатор) для этого поля

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Entities\User\Settings;

class User extends Model
{
    //...

    protected function getSettingsAttribute($value){
        return Settings::make($value);
    }

    protected function setSettingsAttribute($value){
        $this->attributes['settings'] =  Settings::make($value)->toJson();
    }
}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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 ~30 days

Total

3

Last Release

2225d ago

### Community

Maintainers

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

---

Top Contributors

[![max-kut](https://avatars.githubusercontent.com/u/12911259?v=4)](https://github.com/max-kut "max-kut (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[illuminate/support

The Illuminate Support package.

583107.1M34.5k](/packages/illuminate-support)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[spatie/laravel-route-attributes

Auto register routes using PHP attributes

879963.2k18](/packages/spatie-laravel-route-attributes)

PHPackages © 2026

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