PHPackages                             bradietilley/php-data - 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. bradietilley/php-data

ActiveLibrary

bradietilley/php-data
=====================

A lightweight, framework-agnostic Data Transfer Object library for PHP with first-class Laravel integration.

v0.0.1(today)00MITPHPPHP ^8.3CI passing

Since Jul 23Pushed today1 watchersCompare

[ Source](https://github.com/bradietilley/php-data)[ Packagist](https://packagist.org/packages/bradietilley/php-data)[ Docs](https://github.com/bradietilley/laravel-data)[ RSS](/packages/bradietilley-php-data/feed)WikiDiscussions main Synced today

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

Laravel Data
============

[](#laravel-data)

A lightweight, framework-agnostic Data Transfer Object (DTO) library for PHP, with first-class Laravel integration.

[![Static Analysis](https://github.com/bradietilley/php-data/actions/workflows/static.yml/badge.svg)](https://github.com/bradietilley/php-data/actions/workflows/static.yml/badge.svg)[![Tests](https://github.com/bradietilley/php-data/actions/workflows/tests.yml/badge.svg)](https://github.com/bradietilley/php-data/actions/workflows/tests.yml/badge.svg)[![Laravel Version](https://camo.githubusercontent.com/83c7a26073579937b1d321ce410dee32222ce5479f603100455d0034e8a1b1cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c25323056657273696f6e2d31332e782d463933323243)](https://camo.githubusercontent.com/83c7a26073579937b1d321ce410dee32222ce5479f603100455d0034e8a1b1cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c25323056657273696f6e2d31332e782d463933323243)[![PHP Version](https://camo.githubusercontent.com/0742096904180c78a3bf41632578254b265ae67e07f02a3832a3dc0224fd7c29/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485025323056657273696f6e2d382e332d344635423933)](https://camo.githubusercontent.com/0742096904180c78a3bf41632578254b265ae67e07f02a3832a3dc0224fd7c29/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485025323056657273696f6e2d382e332d344635423933)

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

[](#documentation)

Full documentation is available at [bradietilley.dev/php-data](https://bradietilley.dev/php-data).

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

[](#installation)

```
composer require bradietilley/php-data
```

```
use BradieTilley\Data\Data;

class ProductData extends Data
{
    public function __construct(
        public string $title,
        public int $reviews,
        public float $rating,
        public CategoryData $category,
    ) {}
}

class CategoryData extends Data
{
    public function __construct(
        public string $title,
        public bool $featured,
    ) {}
}

// Hydrate from an array, model, DTO, stdClass or JSON string, with automatic casting
$product = ProductData::from([
    'title' => 'Denim Jeans',
    'reviews' => '5',
    'rating' => '4.5',
    'category' => [
        'name' => 'Pants',
        'featured' => false,
    ],
]);

// …or construct explicitly with named arguments
$product = ProductData::make(
    title: 'Widget',
    reviews: '5',
    rating: '4.5',
    category: [
        'name' => 'Pants',
        'featured' => false,
    ],
);

$product->category; // CategoryData 'Pants', 'featured' => false ]>

// Serialize
$product->toArray(); // ['title' => 'Widget', 'reviews' => 5, 'rating' => 4.5, 'category' => ['title'  => 'Pants', 'featured' => false]]
```

See the [documentation](https://bradietilley.dev/laravel-data) for hydration, serialization, attributes, and framework-agnostic usage.

Credits
-------

[](#credits)

- [Bradie Tilley](https://github.com/bradietilley)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44430471?v=4)[Bradie Tilley](/maintainers/bradietilley)[@bradietilley](https://github.com/bradietilley)

---

Top Contributors

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

---

Tags

datadata-transfer-objectdtolaravellaraveldataobjectdata-transfer-objectdto

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bradietilley-php-data/health.svg)

```
[![Health](https://phpackages.com/badges/bradietilley-php-data/health.svg)](https://phpackages.com/packages/bradietilley-php-data)
```

###  Alternatives

[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

762649.9k18](/packages/wendelladriel-laravel-validated-dto)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1431.1k](/packages/event4u-data-helpers)[cerbero/laravel-dto

Data Transfer Object (DTO) for Laravel

5813.7k](/packages/cerbero-laravel-dto)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1053.4k2](/packages/yorcreative-laravel-argonaut-dto)[fab2s/dt0

Immutable DTOs with bidirectional casting. No framework required. 8x faster than the alternative.

102.3k1](/packages/fab2s-dt0)

PHPackages © 2026

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