ramsey/uuid compatibility).id/uuid primary keys (common in distributed systems).id; UUIDs must be manually generated (e.g., via Str::uuid() or Ramsey\Uuid\Uuid).BTREE vs. HASH).deleted_at logic if not handled explicitly.id-based queries/relationships remain intact.uuid() vs. manual ->uuid()->unique()).Str::uuid() (simpler, less portable).ramsey/uuid (more standards-compliant, requires additional setup).incrementing model behavior (UUIDs disable this by default).Model::find() expects id unless overridden).int (4-byte), increasing storage/network overhead. Benchmark impact on:
uuid).uuid is used in foreign keys).factory() tests may fail if UUIDs collide).id may require dual-field responses ({ id: 1, uuid: "..." }).Str::uuid() or ramsey/uuid? How will you handle versioning (e.g., UUIDv4 vs. v7 for timestamps)?uuid replace id entirely, or remain a secondary key? How will you handle:
Model::find() (must override getKeyType() and getRouteKey()).incrementing models (UUIDs disable this by default).uuid for relationships? If so, how will you:
belongsTo with foreignKey: 'uuid').UPDATE table SET uuid = uuid())?id, uuid) during migration?ApiResource formatting).UUID type; MySQL uses CHAR(36)).TEXT with manual validation.ramsey/uuid.LogEntry) to test UUID adoption.UuidModelTrait to the model.UuidMigrationHelper::uuid($table).uuid.id + uuid).getRouteKey() to use uuid for API routes.id with uuid as primary key for new models.id-based endpoints in favor of uuid.Model::where('uuid', $value)).belongsTo, hasMany, etc., if configured correctly.id references in:
Model::find() defaults to id; must override:
public function getKeyType()
{
return 'string';
}
incrementing models break with UUIDs (disable with public $incrementing = false;).CHAR(36) vs. PostgreSQL’s UUID type may require type casting.id-dependent logic (e.g., findOrFail, firstOrCreate).uuid.Str::uuid() vs. Ramsey\Uuid).where('uuid', $value) vs. where('id', $value)).id as a secondary key temporarily).uuid: "a1b2c3..." vs. id: 123).getRouteKey() overrides).strtolower()).id; require validation middleware.EXPLAIN to analyze UUID index usage.foreignKey and localKey in `belongsToHow can I help you explore Laravel packages today?