Home - Grazulex/laravel-arc GitHub Wiki
Elegant and modern Data Transfer Objects (DTOs) for Laravel
Welcome to the comprehensive documentation for Laravel Arc - the modern DTO package for Laravel that makes data handling elegant, type-safe, and developer-friendly.
- Quick Start Guide - Get up and running in 5 minutes
- Installation - Detailed installation instructions
- Your First DTO - Create your first DTO step-by-step
- Property Attributes - Learn the unified Property syntax
- Validation - Automatic validation and rules generation
- Type Safety - Strong typing and runtime validation
- Transformation Pipeline - Pre-process data before casting
- Auto-Discovery Relations - Automatically detect Eloquent relations
- Smart Validation Rules - Intelligent validation generation
- Debug & Analysis Tools - Powerful debugging commands
- API Reference - Complete API documentation
- Examples Gallery - Real-world usage examples
- Best Practices - Recommended patterns and approaches
- Migration from v1 to v2 - Upgrade guide with examples
- Breaking Changes - What changed and why
- Changelog - Complete version history
Want to see Laravel Arc in action? Check out our Live Demo! It's an interactive showcase of Laravel Arc's key features:
- 🎯 Real-time DTO creation and validation
- 🔄 Live property transformations
- 🎨 Advanced features in action
- 💡 Code examples you can try immediately
// No more getters/setters!
$user->name = 'John Doe'; // ✅ Direct assignment
echo $user->email; // ✅ Direct access
// One attribute for all types - clean and consistent
#[Property(type: 'string', required: true, validation: 'email')]
public string $email;
#[Property(type: 'enum', class: UserStatus::class)]
public UserStatus $status;
#[Property(type: 'nested', class: AddressDTO::class)]
public AddressDTO $address;
// Rules generated automatically from attributes!
$rules = UserDTO::rules();
// ['email' => 'required|string|email', 'name' => 'required|string']
// Transform data before casting
#[Property(type: 'string', transform: [TrimTransformer::class, LowercaseTransformer::class])]
public string $email; // ' [email protected] ' becomes '[email protected]'
Latest Features:
- 🔄 Transformation Pipeline System - Pre-process data with built-in transformers
- 🔍 Auto-Discovery Relations - Automatic Eloquent relation detection
- 🛡️ Smart Validation Rules - Intelligent pattern-based validation
- 🔧 Debug & Analysis Tools -
dto:analyze
anddto:validate
commands
class UserDTO extends LaravelArcDTO {
#[Property(type: 'string', required: true, validation: 'max:255')]
public string $name;
#[Property(type: 'string', required: true, validation: 'email')]
public string $email;
}
$user = new UserDTO(['name' => 'John', 'email' => '[email protected]']);
echo $user->name; // John
class OrderDTO extends LaravelArcDTO {
#[Property(type: 'nested', class: UserDTO::class)]
public UserDTO $customer;
#[Property(type: 'collection', class: ProductDTO::class)]
public array $items;
#[Property(type: 'enum', class: OrderStatus::class)]
public OrderStatus $status;
}
- 📁 GitHub Repository - Source code and issues
- 🐛 Report Issues - Bug reports and feature requests
- 💬 Discussions - Community discussions
- 📧 Contributing - How to contribute to the project
Requirement | Version |
---|---|
PHP | 8.3+ |
Laravel | 12+ |
Carbon | 3.10+ |
Ready to get started? → Quick Start Guide
Need help with migration? → Migration from v1 to v2
Looking for examples? → Examples Gallery