PHPackages                             agelxnash/laravel-magic-dto - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. agelxnash/laravel-magic-dto

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

agelxnash/laravel-magic-dto
===========================

1.0.1(2y ago)36MITPHPPHP ^8.0

Since Feb 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AgelxNash/magicDto)[ Packagist](https://packagist.org/packages/agelxnash/laravel-magic-dto)[ Fund](https://yoomoney.ru/to/41001299480137)[ RSS](/packages/agelxnash-laravel-magic-dto/feed)WikiDiscussions main Synced yesterday

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

Magic DTO
---------

[](#magic-dto)

[![Total Downloads](https://camo.githubusercontent.com/76a3ba3339431538052cc69af578ce430b40049b84230f2a1163f23b4dab649a/68747470733a2f2f706f7365722e707567782e6f72672f6167656c786e6173682f6c61726176656c2d6d616769632d64746f2f642f746f74616c2e706e67)](https://packagist.org/packages/agelxnash/laravel-magic-dto) [![codecov](https://camo.githubusercontent.com/abef523fd41626e5a1109ade8fc4c3ae56f7ca59e9bf643b9aa246fa6566adc4/68747470733a2f2f636f6465636f762e696f2f67682f4167656c784e6173682f6d6167696344746f2f67726170682f62616467652e7376673f746f6b656e3d55393256424f454e5a4a)](https://codecov.io/gh/AgelxNash/magicDto)

```
class ExampleDto extends MagicDto
{
    public function __construct(
        public int $propInt,
        public float $propFloat,
        public CarbonImmutable $date,
        public ?ExampleDto $nested = null,
    ) {
    }
}
ExampleDto::from([
    'propInt' => 666,
    'propFloat' => '100.5',
    'date' => '2023-12-11',
    'nested' => [
        'date' => '2024-02-23',
        'propInt' => 777,
        'propFloat' => '200.1',
    ],
])
// or
ExampleDto::from([
    'prop_int' => 666,
    'prop_float' => '100.5',
    'date' => '2023-12-11',
    'nested' => [
        'date' => '2024-02-23',
        'prop_int' => 777,
        'prop_float' => '200.1',
    ],
])
```

#### Inject eloquent models

[](#inject-eloquent-models)

`composer require "illuminate/database"` required when you need to use **AgelxNash\\MagicDto\\Attributes\\InjectModel**

```
Class User extends Illuminate\Database\Eloquent\Model {}

class ExampleDto extends MagicDto
{
    public function __construct(
        #[InjectModel(User::class, 'id')]
        public User $user1,
        #[InjectModel(User::class, 'email')]
        public User $user2,
    ) {
    }
}

ExampleDto::from(['user1' => 777]);
ExampleDto::from(['user2' => 'agel-nash@example.com']);
```

### Author

[](#author)

---

  [![](https://camo.githubusercontent.com/09a23f995538d8eeed9b467fb6f7c894998e6df98f8d322e5a16d6419f3282d2/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f62663132643434313832633938323838303135663635633938363139303361613f733d323530)](https://camo.githubusercontent.com/09a23f995538d8eeed9b467fb6f7c894998e6df98f8d322e5a16d6419f3282d2/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f62663132643434313832633938323838303135663635633938363139303361613f733d323530) #### Borisov Evgeniy
 Agel\_Nash

[](#borisov-evgeniyagel_nash)

 Laravel, MODX, Security Audit

 **Telegram**: [@agel\_nash](https://t.me/Agel_Nash)
 **Email**: laravel@agel-nash.ru  #### Donation

[](#donation)

 **ЮMoney**: [41001299480137](https://yoomoney.ru/to/41001299480137)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

2

Last Release

859d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/cd6eeb152aa8a6a81b05883f09f583f4fafbc50935495d79a2d8a01e0e5f9aa6?d=identicon)[Agel Nash](/maintainers/Agel%20Nash)

---

Top Contributors

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

---

Tags

laravelarrayilluminatedto

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agelxnash-laravel-magic-dto/health.svg)

```
[![Health](https://phpackages.com/badges/agelxnash-laravel-magic-dto/health.svg)](https://phpackages.com/packages/agelxnash-laravel-magic-dto)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[illuminate/database

The Illuminate Database package.

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

The official AI SDK for Laravel.

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

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[illuminate/events

The Illuminate Events package.

13557.0M2.1k](/packages/illuminate-events)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)

PHPackages © 2026

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