harris21

Aegis for Laravel — scaffolding and validation helpers for Value Objects.

18
1
100% credibility
Found May 28, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
PHP
AI Summary

Laravel Aegis is a code generation and validation package for PHP/Laravel applications. It helps developers create 'Value Objects'—special classes that wrap simple values like emails, URLs, or codes with built-in validation and cleanup rules. Instead of writing 70+ lines of boilerplate code for each value type, developers run a single command that generates a complete, production-ready class. The package automatically wires these classes into database models, form validation, and test templates. It also includes a scanner that analyzes existing code to suggest which fields would benefit most from this protection. The result is an application where invalid data is rejected at the boundary, never reaching the core business logic.

How It Works

1
💡 You discover the problem with raw values

Your app uses plain strings for emails and URLs everywhere, and nothing validates them until they cause bugs deep in your code.

2
🛡️ You find a tool that writes the protection for you

Laravel Aegis creates special classes that automatically check and clean your values the moment they arrive, blocking bad data before it spreads.

3
You run one command to create your first Value Object

A single command generates a complete Email class that validates, normalizes to lowercase, and includes a test template—everything you need, nothing you don't.

4
You connect your Value Object to your app
🗄️
Wire into your models

Your database automatically uses the Email class when reading and writing, keeping your data clean at the source.

📝
Add to your form validation

Invalid emails are rejected with clear error messages before they ever reach your code.

5
🔍 You scan your app for more opportunities

A built-in scanner walks through your models and database structure, suggesting other fields that would benefit from the same protection.

🎉 Your app is protected at every boundary

Bad values never reach your business logic. Every email, URL, and special field is validated and normalized the moment it enters your system.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 18 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is laravel-aegis?

Laravel-aegis is a PHP package that generates Value Object scaffolding through Artisan commands. Instead of writing 70 lines of boilerplate for each validated primitive, you run one command and get a production-ready class with validation, normalization, Eloquent casting, and test stubs. It also bundles a validation rule and a trait that lets you pull validated Value Object instances straight out of FormRequests.

Why is it gaining traction?

The killer feature is the scanner: it walks your models and migrations, spots columns that look like Value Object candidates (email, uuid, country_code), and prints the exact command to wrap each one. You go from "I should harden these fields" to "here are seven commands ready to run" in seconds. The generated classes are final and readonly, implement Castable for clean Eloquent integration, and include an equals() method for value equality. The validation rule plugs into Laravel's existing Rule API so it reads like any other constraint.

Who should use this?

Laravel developers building domain-driven applications who are tired of writing the same constructor-throw-normalize-cast pattern for every email, UUID, or slug. Teams maintaining large codebases who want to measure how much of their schema is already hardened. Projects on Laravel 13 with PHP 8.3+ that want to enforce invariants at the boundary before primitives touch business logic.

Verdict

The concept is solid and the implementation is thoughtful, but with 18 stars and no visible test suite, this is early-stage software. The documentation is clear and the API is clean, but you would be adopting it before it has a track record. Worth watching if you are already bought into Value Objects; wait for more community validation if you are evaluating it as a team.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.