PHPackages                             mass6/flexible-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mass6/flexible-dto

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mass6/flexible-dto
==================

Data transfer object with validation and value casting

4.11.0(1y ago)14.1kMITPHPPHP ^8.2

Since May 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mass6/flexible-dto)[ Packagist](https://packagist.org/packages/mass6/flexible-dto)[ RSS](/packages/mass6-flexible-dto/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (7)Versions (24)Used By (0)

Flexible data transfer objects with validation, property whitelisting, and custom casts
=======================================================================================

[](#flexible-data-transfer-objects-with-validation-property-whitelisting-and-custom-casts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a60f20d481fd3ddf2b22d07bcdf15f0011267f5c7d27b6524bfaed102f1139a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617373362f666c657869626c652d64746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mass6/flexible-dto)[![Total Downloads](https://camo.githubusercontent.com/6adf2ac73311144d834c5b954a9c66a9d4274c8d4ead48cd2944ef5189730ded/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617373362f666c657869626c652d64746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mass6/flexible-dto)

The aim of this package is to make it really easy to construct Data Transfer Objects with data properties constrained to a specified whitelist. Then, you can choose to construct the DTO by passing in each property individually like a classic DTO, or via an associative array.

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

[](#installation)

You can install the package via composer:

```
composer require mass6/flexible-dto
```

Testing
-------

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Documentation
-------------

[](#documentation)

Check out the documentation at the [Flexibile DTO Documentation](https://sam.ciaramilaro.com/docs/flexible-dto/introduction/) website.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity71

Established project with proven stability

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

Total

20

Last Release

690d ago

Major Versions

1.0.0 → 2.0.02022-05-19

v1.x-dev → 2.1.02022-05-20

2.2.0 → 3.0.02023-03-13

3.0.0 → 4.0.02024-03-04

PHP version history (4 changes)1.0.0PHP ^7.4

2.0.0PHP ^8

3.0.0PHP ^8.1

4.10.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2149382?v=4)[Sam Ciaramilaro](/maintainers/mass6)[@mass6](https://github.com/mass6)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mass6-flexible-dto/health.svg)

```
[![Health](https://phpackages.com/badges/mass6-flexible-dto/health.svg)](https://phpackages.com/packages/mass6-flexible-dto)
```

###  Alternatives

[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)[laravel/ai

The official AI SDK for Laravel.

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

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.4M7](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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