mindtwo/laravel-auto-create-uuid
Auto-fill a UUID v4 on Eloquent models when creating or replicating. Add a trait, add a uuid column, and it just works—no config. Supports custom UUID column names and ensures replicas get a fresh UUID by excluding the UUID attribute on replicate.
id with uuid for APIs, event sourcing, or CQRS patterns). Reduces manual UUID generation boilerplate, accelerating development velocity.webpatser/laravel-uuid). Justifies a "buy" decision for teams already using Laravel, with minimal maintenance overhead.Adopt When:
id to uuid).Look Elsewhere If:
"This package automates UUID generation for Laravel models, reducing development time and ensuring data consistency. By adopting UUIDs as primary keys, we future-proof our system for distributed architectures, multi-tenancy, and APIs—while eliminating manual UUID handling. The zero-config setup (just add a trait) and MIT license make it a low-risk, high-reward decision. It aligns with modern best practices for scalability and interoperability."
Key Outcomes:
"This package solves the pain of manually generating UUIDs for Eloquent models. With a single trait (AutoCreateUuid), every model creation or replication automatically populates a UUID column—skipping invalid/empty values. It’s lightweight, well-tested, and integrates seamlessly with Laravel’s event system. Perfect for teams migrating to UUIDs or needing reliable identifiers for APIs, events, or clones."
Why It’s Worth It:
creating() or replicating() in every model.Str::isUuid()).Migration Path:
$table->uuid('uuid')->unique() to migrations.use AutoCreateUuid; to models.Alternatives Considered:
Ramsey\Uuid)—this package abstracts that away.Risk: None—MIT license, minimal dependencies, and backward-compatible with existing UUID workflows.
How can I help you explore Laravel packages today?