PHPackages                             qbejs/laravel-dto-mapper - 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. qbejs/laravel-dto-mapper

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

qbejs/laravel-dto-mapper
========================

Automatic DTO mapping for Laravel using PHP 8 Attributes

1.3.0(6mo ago)1491MITPHPPHP ^8.1|^8.2|^8.3

Since Oct 17Pushed 6mo agoCompare

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

READMEChangelog (2)Dependencies (6)Versions (7)Used By (0)

📦 Laravel DTO Mapper
====================

[](#-laravel-dto-mapper)

[![Latest Stable Version](https://camo.githubusercontent.com/c219f498aebe63afdd3fce774bf06ea2ef0c82592b6f229511ef56d5066aa068/68747470733a2f2f706f7365722e707567782e6f72672f7162656a732f6c61726176656c2d64746f2d6d61707065722f762f737461626c65)](https://packagist.org/packages/qbejs/laravel-dto-mapper)[![Total Downloads](https://camo.githubusercontent.com/24dd2924dba509725135c0fe9a2c058819f957cca42bb9c6ca6b9a6b86f0af83/68747470733a2f2f706f7365722e707567782e6f72672f7162656a732f6c61726176656c2d64746f2d6d61707065722f646f776e6c6f616473)](https://packagist.org/packages/qbejs/laravel-dto-mapper)[![License](https://camo.githubusercontent.com/b8745316e2521f1f6b45227a723f0d7795a9048bb26f68ebd8d6b0786980d796/68747470733a2f2f706f7365722e707567782e6f72672f7162656a732f6c61726176656c2d64746f2d6d61707065722f6c6963656e7365)](https://packagist.org/packages/qbejs/laravel-dto-mapper)[![PHP Version](https://camo.githubusercontent.com/4f1dda6a588cff30e4cbf376cb5344d18a7fe42e25581a63fef164d207c84b9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7162656a732f6c61726176656c2d64746f2d6d6170706572)](https://packagist.org/packages/qbejs/laravel-dto-mapper)[![Update Packagist](https://github.com/qbejs/laravel-dto-mapper/actions/workflows/packagist.yml/badge.svg)](https://github.com/qbejs/laravel-dto-mapper/actions/workflows/packagist.yml)

Automatic HTTP request mapping to DTO classes in Laravel using **PHP 8 Attributes**. A simple, clean, and type-safe way to handle validation and data mapping in your controllers.

✨ Features
----------

[](#-features)

- 🎯 **PHP 8 Attributes** - Clean and modern syntax
- ✅ **Automatic Validation** - Uses Laravel's built-in Validator
- 🔒 **Type Safety** - Full support for typed properties
- 📁 **File Handling** - Automatic `UploadedFile` mapping
- 📋 **Arrays &amp; Bulk Operations** - Complete array mapping support
- 🚀 **Zero Configuration** - Works out-of-the-box with Package Discovery
- 🧪 **Easy Testing** - DTOs are simple PHP classes

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x

🔧 Installation
--------------

[](#-installation)

```
composer require qbejs/laravel-dto-mapper
```

The Service Provider will be automatically registered via Laravel Package Discovery.

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Create a DTO

[](#1-create-a-dto)

```
