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 1mo ago

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

37

—

LowBetter than 83% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

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

645d 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://www.gravatar.com/avatar/6a5c048ff68d39ba8b61baecd2df7e6fdc3b2a22619fa4beb5ef8244aa129fd8?d=identicon)[mass6](/maintainers/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

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminate/validation

The Illuminate Validation package.

18936.7M1.4k](/packages/illuminate-validation)

PHPackages © 2026

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