New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

grazulex/laravel-arc

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

Larablocks Analysis

grazulex/laravel-arc works with Laravel 12 and 13 (latest release v1.8.0, Nov 28, 2026).

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Nov 28, 2026)
  • 12 downloads a month (needs 10,000)
  • 9 GitHub stars (needs 100)

State

Actively maintained
  • Last stable release: Nov 28, 2026.
  • 10 releases in the last 12 months.
  • First released: Jul 20, 2025.
  • Monthly downloads: 12.
  • 2 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require grazulex/laravel-arc
Latest Version:v1.8.0
PHP:^8.4
Laravel:12 · 13
License:MIT
Last Updated:Nov 30, 2026
Links: GitHub  ·  Packagist
Maintainer: Grazulex

Laravel Arc

Laravel Arc

[!TIP] What Laravel Arc does for you — Describe your DTOs in YAML and Arc generates the typed, validated PHP classes for you. No more hand-written DTOs slowly drifting away from your validation rules.

This package is free and maintained on my own time. If it saves you hours, a small contribution helps me keep it going: 💖 GitHub Sponsors · ☕ Buy Me a Coffee · PayPal

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 Total Downloads License PHP Version Laravel Version Tests Code Style

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

  • 🏗️ YAML-Driven Generation - Define DTOs in clean, readable YAML
  • 🔒 Type Safety - Full PHP 8.4+ 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.4+ features and best practices

🔧 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

➡️ Visit the Wiki for complete documentation, examples, and guides

The wiki contains:

📦 Quick Installation

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

🚀 Quick Start

  1. Create a DTO definition:
php artisan dto:definition-init UserDTO --model=App\\Models\\User --table=users
  1. Generate the DTO class:
php artisan dto:generate user.yaml
  1. 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

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

🔧 Requirements

  • PHP: 8.4+
  • Laravel: 12.x or 13.x
  • Carbon: ^3.10
  • grazulex/laravel-modelschema: ^1.2

🧪 Testing

composer test

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

🔒 Security

Please review our Security Policy for reporting vulnerabilities.

💖 Support This Package

Laravel Arc is free, open source and maintained on my own time. If it saves you hours, here is how you can give back:

📄 License

Laravel Arc is open-sourced software licensed under the MIT license.


Made with ❤️ by Jean-Marc Strauven

Alternatives to grazulex/laravel-arc

wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

896,239 773
nutgram/hydrator

Hydrator for PHP 8.0+

557,906 11
event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes Da...

42,487 15
yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that su...

13,428 107
std-out/simple-data-objects

Lightweight typed Data Transfer Object library for PHP 8.4+ with attribute-drive...

1,120 35

Version History

Version Released PHP Laravel License
v1.8.0 ^8.4 ^12.0|^13.0 MIT
v1.7.0 ^8.4 ^12.0|^13.0 MIT
v1.6.2 ^8.4 ^12.0|^13.0 MIT
v1.6.1 ^8.4 ^12.0|^13.0 MIT
v1.6.0 ^8.4 ^12.0|^13.0 MIT