PHPackages                             honeystone/laravel-dto-tools - 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. honeystone/laravel-dto-tools

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

honeystone/laravel-dto-tools
============================

Comprehensive set of DTO Tools for Laravel.

1.3.0(1mo ago)515511MITPHPPHP ^8.2

Since Aug 1Pushed 1mo ago3 watchersCompare

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

READMEChangelogDependencies (26)Versions (5)Used By (0)

Honeystone DTO Tools for Laravel
================================

[](#honeystone-dto-tools-for-laravel)

[![Static Badge](https://camo.githubusercontent.com/f3d59aabff905e2e09d3e1b80623b50094f8ab04aa7f9ed4e8e3b9b802d360df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d677265656e)](https://camo.githubusercontent.com/f3d59aabff905e2e09d3e1b80623b50094f8ab04aa7f9ed4e8e3b9b802d360df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d677265656e)[![GitHub License](https://camo.githubusercontent.com/82ccb8150b6b686e3e8516bc635d2eb7ab323916c36055bcf5f2140612b119cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c73)](https://camo.githubusercontent.com/82ccb8150b6b686e3e8516bc635d2eb7ab323916c36055bcf5f2140612b119cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c73)[![Latest Version on Packagist](https://camo.githubusercontent.com/6c34a1597d889fd4212f2564a3fbf70b9456aac5bff69983ad638baa5cd3a433/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c73)](https://packagist.org/packages/honeystone/laravel-dto-tools)[![Packagist Dependency Version](https://camo.githubusercontent.com/6c618d97224e2c7de1442c508906f5b4875faafb7b28a0eee8ded92aecba8d89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c732f706870)](https://camo.githubusercontent.com/6c618d97224e2c7de1442c508906f5b4875faafb7b28a0eee8ded92aecba8d89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c732f706870)[![Packagist Dependency Version](https://camo.githubusercontent.com/9a3139a638167626c2c716a5ef77ae75adac477672943520904a9964d2ef8f20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c732f696c6c756d696e617465253246636f6e7472616374733f6c6162656c3d6c61726176656c)](https://camo.githubusercontent.com/9a3139a638167626c2c716a5ef77ae75adac477672943520904a9964d2ef8f20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f686f6e657973746f6e652f6c61726176656c2d64746f2d746f6f6c732f696c6c756d696e617465253246636f6e7472616374733f6c6162656c3d6c61726176656c)[![Static Badge](https://camo.githubusercontent.com/e61201a0b597af203de29c5edeadfa50ca0eae170c3c27ade60d457258ec2b91/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f686f6e657973746f6e652d666136393030)](https://honeystone.com)

DTO tools is a package designed to bring additional power and convenience to your native PHP data transfer objects. The main motivation for this package was to remove much of the boilerplate created moving data in to and out of DTOs. For example, transforming snake-cased model attributes to camel-cased to be consumed by your presentation layer, or casting a user inputted numerical string (after validation ofc) to an integer.

Features include property casting and mutation, serialization, patch data handling, relationships, and model and collection transformation.

Support us
----------

[](#support-us)

[![Support Us](https://camo.githubusercontent.com/47b52a4f75e2fb7d68935d4d0e6be24ed00d74064147121c1b0658a7faea6da0/68747470733a2f2f686f6e657973746f6e652e636f6d2f696d616765732f6769746875622f737570706f72742d75732e77656270)](https://honeystone.com)

We are committed to delivering high-quality open source packages maintained by the team at Honeystone. If you would like to support our efforts, simply use our packages, recommend them and contribute.

If you need any help with your project, or require any custom development, please [get in touch](https://honeystone.com/contact-us).

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

[](#installation)

```
composer require honeystone/laravel-dto-tools
```

Publish the configuration file with:

```
php artisan vendor:publish --tag=honeystone-dto-tools-config
```

Usage
-----

[](#usage)

This package requires very little modification to your existing DTOs. As a minimum, your DTOs need to implement the `Transferable` contract and use the `HasTransferableData` trait, like so:

```
