Aegis is a new Laravel package that automates the boilerplate of creating Value Objects in PHP. A single Artisan command (`make:value-object`) generates a `final readonly` class with validation, normalization, Eloquent casting, and a test stub. It also registers a `Rule::valueObject()` macro for use in FormRequests and provides a `ResolvesValueObjects` trait to retrieve validated instances directly. A `vo:scan` command analyzes existing Eloquent models and migrations to identify primitive columns that are candidates for Value Object wrapping, reporting a coverage percentage. Requires PHP 8.3+ and Laravel 13.
Table of contents
# The Problem# Installation# Scaffolding a Value Object# Validating With the Same Value Object# Resolving the Validated Instance# Finding Candidates in Your Codebase# The Flags# Requirements# Links# About the Name17.9K Impressions