Download the PHP package yorcreative/laravel-argonaut-dto without Composer

On this page you can find all versions of the php package yorcreative/laravel-argonaut-dto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-argonaut-dto



Laravel Argonaut DTO

GitHub license GitHub stars GitHub Org's stars GitHub issues GitHub forks PHPUnit

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:


πŸ“¦ 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<ClassName>, 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 Example: Product + Features + Reviews

This example demonstrates nested relationships and complex type casting in action.

ProductDTO with nested casting:

ProductDTOAssembler mapping input structure:


🎯 DTOs with Prioritized Attributes and Custom Setters

ArgonautDTO allows you to prioritize the assignment of specific fields using $prioritizedAttributes, which is critical for cases where one field influences others.


πŸ” Casting Reference

Casting allows you to automatically transform values into other DTOs, Laravel Collections, arrays, dates, and more.

Cast Type Example Description
Scalar 'string', 'int', etc. Native PHP type cast
Single DTO ProfileDTO::class Cast an array to a DTO instance
Array of DTOs [RoleDTO::class] Cast to array of DTOs
Collection of DTOs Collection::class . ':' . CommentDTO::class Cast to a Laravel Collection
Date casting Carbon::class Cast to Carbon/DateTime instance

βœ… Validation

Validate DTOs with Laravel’s validator:


πŸ“€ Serialization

Serialize DTOs for output, API responses, etc.


πŸ› οΈ DTO Collection Helper

Create DTO collections directly:


πŸ§ͺ Testing

Run the test suite using:


πŸ“š Credits


πŸ“ƒ License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-argonaut-dto with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4
illuminate/contracts Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yorcreative/laravel-argonaut-dto contains the following files

Loading the files please wait ....