PHPackages                             vkoori/laravel-model-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. [Database &amp; ORM](/categories/database)
4. /
5. vkoori/laravel-model-dto

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

vkoori/laravel-model-dto
========================

generate entity dto like dotrine

0.2.1(10mo ago)031PHP

Since Jul 11Pushed 10mo agoCompare

[ Source](https://github.com/vkoori/laravel-model-dto)[ Packagist](https://packagist.org/packages/vkoori/laravel-model-dto)[ RSS](/packages/vkoori-laravel-model-dto/feed)WikiDiscussions master Synced 1mo ago

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

### Installation

[](#installation)

You can install the package via Composer:

```
composer require vkoori/laravel-model-dto
```

> 💡 This package requires Laravel 8+ and PHP 8.0+

---

### Configuration

[](#configuration)

1. Add `\Vkoori\EntityDto\EntityDtoProvider` to Providers list.
2. Create `config/dto.php` to define which DTOs should be generated:

```
return [
    'User' => [
        'id' => [
            'type' => 'int',
            'fillable' => false,
            'cast' => false,
        ],
        'name' => [
            'type' => 'string',
            'fillable' => true,
            'cast' => false,
        ],
        'email' => [
            'type' => '?string',
            'fillable' => true,
            'cast' => false,
        ],
        'status' => [
            'type' => '\App\Enums\StatusEnum',
            'fillable' => true,
            'cast' => true,
        ],
        'is_active' => [
            'type' => 'bool',
            'fillable' => true,
            'cast' => false,
        ],
        'deleted_at' => [
            'type' => '?\Carbon\Carbon',
            'fillable' => false,
            'cast' => false,
        ],
    ],
    // Add more entities as needed
];
```

---

### Usage

[](#usage)

1. Generate a DTO using Artisan:

```
php artisan make:dto User --module=Users
```

2. Use the Trait in Your Model to automatically setup $fillable and $casts properties

```
use Illuminate\Database\Eloquent\Model;
use Vkoori\EntityDto\Traits\AutoFillableAndCasts;

class User extends Model
{
    use AutoFillableAndCasts;
}
```

---

### Support

[](#support)

If you find this package useful, please consider starring it on GitHub or sharing it with others.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance54

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

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

305d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87c1574170082a3c779cca97f90846e478dcc46114fc66480fbd04975b71a746?d=identicon)[vkoori](/maintainers/vkoori)

---

Tags

laraveleloquentdto

### Embed Badge

![Health badge](/badges/vkoori-laravel-model-dto/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

3593.5k](/packages/baril-bonsai)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)

PHPackages © 2026

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