PHPackages                             tsarturi/simpledto - 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. tsarturi/simpledto

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

tsarturi/simpledto
==================

Simple Data Transfer Objects with FormRequest Validation for Laravel applications

v1.0.5(3y ago)210MITPHPPHP ^8.0

Since May 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tsarturi/SimpleDTO)[ Packagist](https://packagist.org/packages/tsarturi/simpledto)[ RSS](/packages/tsarturi-simpledto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (6)Used By (0)

SimpleDTO
=========

[](#simpledto)

 Simple Data Transfer Objects with FormRequest Validation for Laravel applications. This library was based on  .

[![Packagist](https://camo.githubusercontent.com/2ca632f32602ea91554433236e30f52c65260015bad2c514b32016b993b36885/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74736172747572692f73696d706c6564746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tsarturi/simpledto)[![PHP from Packagist](https://camo.githubusercontent.com/570a0dd1663f7cac2460c452fd90352a03b994f804772b140df0c2ca89df8f22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f74736172747572692f73696d706c6564746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tsarturi/simpledto)[![Laravel Version](https://camo.githubusercontent.com/94098a6153fe43274a2ef0126e8f7c6d0bf4a67d9b662c44ffcd99efb64202bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392e782c25323031302e782d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tsarturi/simpledto)

 [Features](#features) | [Installation](#installation) | [Configuration](#configuration) | [Generating DTOs](#generating-dtos) | [Generating FormRequest](#generating-formrequest)

Features
--------

[](#features)

Features:

- Allows the creation of DTO's easily and quickly.
- Easy integration into your existing projects.
- Validation of the data in the same way that it validates the **Request**.
- Use **FormRequest** for validation and authorization.
- Custom validation messages.
- Easy data conversion.
- Definition of default values.

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

[](#installation)

```
composer require tsarturi/simpledto

```

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --provider="Tsarturi\SimpleDTO\Providers\SimpleDTOServiceProvider" --tag=config

```

Generating DTOs
---------------

[](#generating-dtos)

You can create DTOs using the `make:simpledto` command:

```
php artisan make:simpledto UserDTO

```

It's create an UserDTO class into App\\DTOs folder.

Generating FormRequest
----------------------

[](#generating-formrequest)

You can create FormRequest class using the `make:simpledtoformrequest` command:

```
php artisan make:simpledtoformrequest UserStoreRequest

```

It's create an UserStoreRequest into Form Request's folder

Using DTO's
-----------

[](#using-dtos)

```
