cline/variable-keys
Laravel Blueprint macros for variable primary key types, matching foreign keys, and polymorphic morph types. Easily switch between id/uuid/ulid (and more) via enums/config to keep migrations consistent across models and relationships.
integer for staging, uuid for production).comments, audit_logs) by aligning polymorphic key types with Laravel conventions, reducing edge cases in morphTo/morphWith relationships.match logic in migrations when switching key types (e.g., from id() to uuid()), accelerating schema evolution for greenfield projects or large refactors..env or config) to enforce consistency across microservices or modular monoliths, reducing merge conflicts in shared repositories.laravel-uuid + spatie/laravel-activitylog) for basic key type flexibility, reducing technical debt.comments, audit_logs) and want to avoid manual morphMap adjustments for non-integer keys.id to uuid), and repetitive match logic is a pain point.ramsey/uuid or webpatser/laravel-uuid.MorphMap directly.For Executives: "This package lets us standardize how our database keys work—whether they’re simple numbers or unique IDs—without rewriting migrations every time we add a new table. It cuts down on errors from mismatched foreign keys and makes it easier to switch key types later if we need to (e.g., for security or scalability). For example, if we later decide to use UUIDs for all user IDs to prevent collisions in a multi-tenant system, we can flip a config switch and let the package handle the rest. This saves dev time, reduces bugs, and keeps our schema flexible for future needs."
For Engineers:
*"variable-keys replaces verbose match expressions in migrations with clean macros like $table->variablePrimaryKey() and $table->variableForeignKey(). It handles:
uuid, integer, string) and reuse across migrations.morphTo/morphWith for shared tables like comments or audit_logs.Perfect for:
match logic for every migration.Trade-offs:
How can I help you explore Laravel packages today?