{"repo":"YorCreative/Laravel-Argonaut-DTO","free":true,"listed":false,"github":"https://github.com/YorCreative/Laravel-Argonaut-DTO","clone":"git clone https://github.com/YorCreative/Laravel-Argonaut-DTO.git","description":"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.","language":"PHP","stars":106,"topics":["architecture-patterns","backend-development","data-transfer-object","dto","laravel","laravel-dto","laravel-package","object-oriented-programming","php-dto","serialization"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Argonaut DTO Laravel Argonaut DTO is a lightweight, highly composable package for transforming arrays, objects, or collections into structured DTOs (Data Transfer Objects), with built-in support for: - 🧱 Deep nested transformation and casting - 🔁 Type-safe data conversion - ✅ Validation using Laravel's validator - 🧠 Explicit attribute prioritization - 📦 Clean serialization ( toArray , toJson ) - 🔒 Immutable DTOs with readonly properties - ♻️ Consistent data shape enforcement across boundaries --- 📦 Requirements - PHP 8.2, 8.3, 8.4, or 8.5 (PHP 8.3+ when using Laravel 13) - Laravel 10.x, 11.x, 12.x, or 13.x --- 📦 Installation Install via Composer: --- 🚀 Quick Start 1. Define a DTO DTOs extend ArgonautDTO , and define your expected structure via public properties, casting rules, and validation. This defines a strongly typed DTO with both validation rules and simple type casting. --- 2. Create an Assembler Assemblers are responsible for mapping raw inputs (arrays or objects) into your DTOs. Assembler method names must follow the format to or from , and are resolved automatically using class basename . --- 3. Assemble a DTO Use the assembler to transform raw data into structured, casted DTO instances. You can also batch transform arrays or collections: --- 🧪 Real-World Static Usage Example: Product + Features + Reviews This example demonstrates nested relationships and complex type casting in action. ProductDTO with nested casting: ProductDTOAssembler mapping inp","default_branch":null,"files":null,"tree":[],"storefront":"/r/YorCreative","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/YorCreative/Laravel-Argonaut-DTO/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}