stayallive/laravel-eloquent-uuid
Pros:
Cons:
CHAR(36) vs. BINARY(16)).Compatibility:
SoftDeletes, Timestamps).Technical Risk:
INT to UUID).Why UUIDs?
Laravel Version Compatibility
Database Considerations
UUID type, MySQL’s CHAR(36) vs. BINARY(16))?Migration Strategy
Performance and Scaling
Long-Term Maintenance
Laravel Ecosystem:
Laravel Scout for search, Laravel Nova for admin panels) as long as they support UUID primary keys.Database Layer:
UUID type support; minimal configuration needed.CHAR(36) for storage (avoid BINARY(16) for compatibility with Laravel’s UUID casting).sqlite3_uuid or manual handling of UUID strings.RAW(16) or CHAR(36) with custom types.Frontend/Client Impact:
Assessment Phase:
unsignedBigInteger constraints).Schema Migration:
Schema::create('users', function (Blueprint $table) {
$table->uuid('id')->primary();
// ...
});
uuid column alongside the existing id column.id column once all dependencies are updated.Model Integration:
UsesUUID trait to target models:
use Stayallive\Laravel\Eloquent\UUID\UsesUUID;
class User extends Model {
use UsesUUID;
}
bootUsesUUID method.Testing:
Model::create() in loops).Deployment:
laravel/breeze, spatie/laravel-permission), but test thoroughly.HasUUID trait with custom logic.Phase 1: Proof of Concept
LogEntry) to validate the approach.Phase 2: Core Models
User, Product) to UUIDs.Phase 3: Legacy Systems
Phase 4: Full Adoption
Pros:
Cons:
How can I help you explore Laravel packages today?