PHPackages                             grazulex/laravel-arc - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. grazulex/laravel-arc

ActiveLibrary[Testing &amp; Quality](/categories/testing)

grazulex/laravel-arc
====================

A Laravel package for elegant and modern Data Transfer Objects (DTOs) management with automatic validation and direct property access

v1.3.0(9mo ago)826MITPHPPHP ^8.3CI passing

Since Jul 20Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/Grazulex/laravel-arc)[ Packagist](https://packagist.org/packages/grazulex/laravel-arc)[ Docs](https://github.com/grazulex/laravel-arc)[ Fund](https://paypal.me/strauven)[ GitHub Sponsors](https://github.com/Grazulex)[ RSS](/packages/grazulex-laravel-arc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

Laravel Arc
===========

[](#laravel-arc)

[![Laravel Arc](new_logo.png)](new_logo.png)

Generate modern, type-safe Data Transfer Objects (DTOs) in Laravel from clean YAML definitions — with automatic validation, nested support, and fluent collection handling.

[![Latest Version](https://camo.githubusercontent.com/d411ffa2ee66b194e14be09d983e442bf65fa9ed2d12ac0603faa7d12c32fd10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772617a756c65782f6c61726176656c2d6172632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-arc)[![Total Downloads](https://camo.githubusercontent.com/05be7c0fb28c633dd606f000e5d2eebf649e26784689f22eaceb0088070d4022/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772617a756c65782f6c61726176656c2d6172632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-arc)[![License](https://camo.githubusercontent.com/77dff6dd8cf7d75600d656cb56fb92979aaaa1905b3a678db39fed8197183f9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6772617a756c65782f6c61726176656c2d6172632e7376673f7374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-arc/blob/main/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/60542c88ec27e05c1df20f31dbd1134de5d4eefed04dde26aa5367e7aab6066a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772617a756c65782f6c61726176656c2d6172632e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/7592d340e2de1142fa869382b819654d6a0bf7baf8e3c8aded777d652d68c01a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31322e782d6666326432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com/)[![Tests](https://camo.githubusercontent.com/39f8f1371ed39c45c89939df992fd1df06cab1d916fe45c5300298ee516b964c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772617a756c65782f6c61726176656c2d6172632f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-arc/actions)[![Code Style](https://camo.githubusercontent.com/161d70e6871f808e0439b3e7a86540993ae98775540b5a2e78226000e3c419c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d3030303030303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://github.com/laravel/pint)

Overview
--------

[](#overview)

Laravel Arc is a powerful Laravel package that simplifies Data Transfer Object (DTO) management through YAML-driven generation. Define your DTOs in simple YAML files and let Laravel Arc generate type-safe, validated PHP classes with automatic property access and comprehensive collection support.

**Think of it as Laravel API Resources, but with stronger typing, automatic validation, and generated from YAML definitions.**

### 🎯 Key Features

[](#-key-features)

- **🏗️ YAML-Driven Generation** - Define DTOs in clean, readable YAML
- **🔒 Type Safety** - Full PHP 8.3+ type enforcement with readonly properties
- **✅ Automatic Validation** - Generate Laravel validation rules from field definitions
- **� ModelSchema Integration** - 65+ advanced field types (geometric, JSON, enhanced validation)
- **�🔄 Field Transformers** - Built-in data transformation (trim, slugify, normalize, etc.)
- **📊 Export Formats** - Convert to JSON, XML, CSV, YAML, and more
- **🎯 Behavioral Traits** - Timestamps, UUIDs, soft deletes, and tagging
- **🚀 Modern PHP** - Leverages PHP 8.3+ features and best practices

### 🔧 Advanced Field Types (ModelSchema Integration)

[](#-advanced-field-types-modelschema-integration)

Laravel Arc integrates with **grazulex/laravel-modelschema** to provide **65+ advanced field types**:

```
# Traditional Arc types
fields:
  name:
    type: string
  age:
    type: integer

# Advanced ModelSchema types
fields:
  coordinates:
    type: point          # Geographic point
  boundary:
    type: polygon        # Geographic polygon
  metadata:
    type: json           # JSON with validation
  tags:
    type: set            # Set collection
  email:
    type: email          # Enhanced email validation
  settings:
    type: jsonb          # PostgreSQL JSONB
```

**Supported Advanced Types:**

- **🌍 Geometric**: `point`, `polygon`, `geometry`, `linestring`
- **📋 JSON**: `json`, `jsonb`, `set`, `array`
- **📧 Enhanced String**: `email`, `uuid`, `url`, `slug`, `phone`
- **🔢 Numeric Variations**: `bigint`, `tinyint`, `decimal`, `money`
- **📅 Date/Time**: `datetime`, `timestamp`, `date`, `time`

### 📚 Complete Documentation

[](#-complete-documentation)

**➡️ [Visit the Wiki for complete documentation, examples, and guides](https://github.com/Grazulex/laravel-arc/wiki)**

The wiki contains:

- **[Installation &amp; Setup](https://github.com/Grazulex/laravel-arc/wiki/Installation-Setup)**
- **[Your First DTO](https://github.com/Grazulex/laravel-arc/wiki/Your-First-DTO)**
- **[Field Types](https://github.com/Grazulex/laravel-arc/wiki/Field-Types)**
- **[Field Transformers](https://github.com/Grazulex/laravel-arc/wiki/Field-Transformers)**
- **[Artisan Commands](https://github.com/Grazulex/laravel-arc/wiki/Artisan-Commands)**
- **[Complete Examples](https://github.com/Grazulex/laravel-arc/wiki/Complete-Examples)**

📦 Quick Installation
--------------------

[](#-quick-installation)

```
composer require grazulex/laravel-arc
php artisan vendor:publish --provider="Grazulex\LaravelArc\LaravelArcServiceProvider"
```

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

[](#-quick-start)

1. **Create a DTO definition:**

```
php artisan dto:definition-init UserDTO --model=App\\Models\\User --table=users
```

2. **Generate the DTO class:**

```
php artisan dto:generate user.yaml
```

3. **Use your DTO:**

```
$userData = ['name' => 'John Doe', 'email' => 'john@example.com'];
$userDto = UserDTO::fromArray($userData);

echo $userDto->name; // 'John Doe'
echo $userDto->toJson(); // JSON representation
```

⚠️ Important Notes
------------------

[](#️-important-notes)

### YAML Validation Rules with Commas

[](#yaml-validation-rules-with-commas)

When using validation rules that contain commas (like `exists:table,column`), wrap them in quotes:

```
# ❌ Wrong - gets split into separate rules
rules: [required, exists:users,id]

# ✅ Correct - stays as one rule
rules: [required, "exists:users,id"]
```

This applies to rules like: `"exists:table,column"`, `"unique:table,column"`, `"in:value1,value2,value3"`, etc.

📖 Learn More
------------

[](#-learn-more)

- **[📚 Complete Documentation](https://github.com/Grazulex/laravel-arc/wiki)** - Full guides and API reference
- **[🚀 Installation &amp; Setup](https://github.com/Grazulex/laravel-arc/wiki/Installation-Setup)** - Installation and first steps
- **[💡 Complete Examples](https://github.com/Grazulex/laravel-arc/wiki/Complete-Examples)** - Real-world usage examples
- **[🔧 Behavioral Traits](https://github.com/Grazulex/laravel-arc/wiki/Behavioral-Traits)** - Advanced features and traits

🔧 Requirements
--------------

[](#-requirements)

- **PHP:** ^8.3
- **Laravel:** ^12.19
- **Carbon:** ^3.10

🧪 Testing
---------

[](#-testing)

```
composer test
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#-security)

Please review our [Security Policy](SECURITY.md) for reporting vulnerabilities.

📄 License
---------

[](#-license)

Laravel Arc is open-sourced software licensed under the [MIT license](LICENSE.md).

---

**Made with ❤️ by [Jean-Marc Strauven](https://github.com/Grazulex)**

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance58

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

280d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/888105bd54b6b7f7905523a16a1d08eebc2e5d39b19a4c174b5961bb4d52929b?d=identicon)[Grazulex](/maintainers/Grazulex)

---

Top Contributors

[![Grazulex](https://avatars.githubusercontent.com/u/4521546?v=4)](https://github.com/Grazulex "Grazulex (208 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (67 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

dtolaravellaravel-packagephp8validationpestlaravelvalidationattributesdata-transfer-objectdtophp8

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/grazulex-laravel-arc/health.svg)

```
[![Health](https://phpackages.com/badges/grazulex-laravel-arc/health.svg)](https://phpackages.com/packages/grazulex-laravel-arc)
```

###  Alternatives

[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

759569.4k13](/packages/wendelladriel-laravel-validated-dto)[grazulex/laravel-devtoolbox

Swiss-army artisan CLI for Laravel — Scan, inspect, debug, and explore every aspect of your Laravel application from the command line.

1535.4k](/packages/grazulex-laravel-devtoolbox)[yorcreative/laravel-argonaut-dto

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.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[fab2s/dt0

Immutable DTOs with bidirectional casting. No framework required. 8x faster than the alternative.

101.6k1](/packages/fab2s-dt0)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1421.5k](/packages/event4u-data-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
