PHPackages                             lark/entity - 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. lark/entity

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

lark/entity
===========

Lark Entity

1.0.1(3y ago)1115MITPHP

Since May 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shayanderson/lark-entity)[ Packagist](https://packagist.org/packages/lark/entity)[ Docs](https://github.com/shayanderson/lark-entity)[ RSS](/packages/lark-entity/feed)WikiDiscussions 1.x Synced 1mo ago

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

Lark Entity
===========

[](#lark-entity)

The Entity class is used to simplify creating data classes, creating class properties from an array and creating an array from class properties.

Install using Composer:

```
composer require lark/entity

```

Example:

```
use Lark\Entity;

// class must be subclass of Entity
class Location extends Entity
{
    public string $address;
    public string $city;
}

class User extends Entity
{
    // properties must be public and typed
    // union types are not supported
    public string $name;
    public int $age;
    public bool $isActive = false; // default values
    public Location $location; // deep nested classes supported
}

// populate from array
$user = new User([
    'name' => 'Bob',
    'age' => 25,
    'location' => [
        'address' => '101 main',
        'city' => 'Tampa'
    ]
]);
// or use: $user->fromArray([...])

echo $user->name; // Bob
echo $user->location->address; // 101 main

// get as array
$userArr = $user->toArray(); // [name => Bob, ...]
```

View the `tests/entity.php` file for more examples.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

1095d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9afe104558d1ec4d6b401385e9bdc9af7540b6fa43c019eb964fa0eb9b0c01c1?d=identicon)[lark](/maintainers/lark)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lark-entity/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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