PHPackages                             splitstack/aristotle - 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. [Framework](/categories/framework)
4. /
5. splitstack/aristotle

ActiveLibrary[Framework](/categories/framework)

splitstack/aristotle
====================

DDD entity scaffolding and base classes for Laravel Splitstack applications

0.1.0(1mo ago)1119↓82.9%MITPHPPHP ^8.2CI passing

Since May 30Pushed 1mo agoCompare

[ Source](https://github.com/EmilienKopp/aristotle)[ Packagist](https://packagist.org/packages/splitstack/aristotle)[ RSS](/packages/splitstack-aristotle/feed)WikiDiscussions main Synced 1w ago

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

Aristotle
=========

[](#aristotle)

DDD entity scaffolding and base classes for Laravel applications.

Aristotle generates typed, immutable entity classes from your Eloquent models by reading the database schema and respecting your model's `$casts`. Entities implement `Arrayable`, `ArrayAccess`, and `IteratorAggregate` out of the box.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

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

[](#installation)

```
composer require splitstack/aristotle
```

The service provider is auto-discovered. Optionally publish the config and/or stub:

```
php artisan vendor:publish --tag=aristotle-config
php artisan vendor:publish --tag=aristotle-stubs
```

Generating an entity
--------------------

[](#generating-an-entity)

```
php artisan make:entity
```

The command will prompt you to choose a model and a domain. You can also pass everything as options:

```
php artisan make:entity User --model=User --domain=Auth
```

### Options

[](#options)

OptionDescription`--model=`Eloquent model to scaffold from`--domain=`Bounded context / domain folder`--namespace=`Override the full namespace (skips the domain prompt)`--database=`Database to connect to (useful in multi-tenant setups)`--force`Overwrite the entity if it already existsThe command reads the model's table columns and `$casts`, then writes a typed entity class. For example, given a `users` table with `id`, `name`, `email`, and `email_verified_at` columns, the output is:

```
// app/Domain/Auth/Entities/UserEntity.php

namespace App\Domain\Auth\Entities;

use Carbon\CarbonInterface;
use Splitstack\Aristotle\BaseEntity;

final class UserEntity extends BaseEntity
{
    public function __construct(
        public ?int $id = null,
        public string $name,
        public string $email,
        public ?CarbonInterface $email_verified_at = null,
    ) {}
}
```

Using an entity
---------------

[](#using-an-entity)

```
$user = UserEntity::fromArray($model->toArray());

$user->name;          // typed access
$user['email'];       // ArrayAccess
foreach ($user as $key => $value) { ... }   // iterable
$user->toArray();     // back to array
```

Entities are **immutable** — attempting to set or unset a property via array access throws a `BadMethodCallException`.

Configuration
-------------

[](#configuration)

```
// config/aristotle.php

return [
    // Root namespace for all domains
    'namespace' => 'App\\Domain',

    // Sub-folder appended after the domain name
    // e.g. "Entities" → App\Domain\Auth\Entities
    // Set to null or '' to place entities directly under the domain
    'entities_folder' => 'Entities',

    // Optional suffix appended to generated class names
    // e.g. "Entity" → UserEntity
    'entity_suffix' => env('ARISTOTLE_ENTITY_SUFFIX', 'Entity'),
];
```

Type resolution
---------------

[](#type-resolution)

Column types and Eloquent casts are mapped to PHP types automatically:

Cast / column typePHP type`int`, `integer``int``bool`, `boolean``bool``float`, `double`, `real`, `decimal``float` / `string``string`, `encrypted`, `hashed``string``date`, `datetime`, `immutable_date/datetime``CarbonInterface``array`, `json`, `encrypted:array``array``collection`, `encrypted:collection``Collection``object`, `encrypted:object``object``timestamp``int``AsStringable``Stringable``AsUri``Uri``AsFluent``Fluent`Enum castenum typeCustom `CastsAttributes`resolved from `@implements` docblockNullable columns and auto-increment columns are generated as nullable (`?Type = null`).

Extending the stub
------------------

[](#extending-the-stub)

After publishing the stub (`vendor:publish --tag=aristotle-stubs`), edit `stubs/entity.stub`. The available placeholders are `{{ namespace }}`, `{{ imports }}`, `{{ class }}`, and `{{ properties }}`.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelscaffoldingddddomainentities

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/splitstack-aristotle/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20432.6M1.7k](/packages/illuminate-queue)[laravel/cashier

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

2.5k30.2M151](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M136](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)

PHPackages © 2026

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