tuupola/ksuid
PHP library for generating and parsing KSUIDs: globally unique, K-sortable identifiers with a timestamp component. Produces compact 27-character Base62 strings, useful for database keys and distributed systems where time-ordered IDs matter.
tuupola/ksuid is a pure Composer library, not a Laravel service-provider package. That is a reasonable fit: treat it as an ID generator/value object and integrate through Eloquent model traits, casts, and migrations. It is best suited to API-facing public identifiers where time-sortable, non-sequential IDs are useful. It does not replace relational keys or foreign-key discipline.char(27) with binary/ASCII collation or binary(20), and configure Eloquent with $incrementing = false and $keyType = 'string'. Route model binding works if the key is a string. Existing primary-key replacement is materially harder because of foreign keys, queues, logs, exports, and external consumers.bigint but smaller than UUID text.public_id/ksuid column while retaining the numeric primary key.ascii_bin or binary(20); Postgres should use varchar(27)/bytea; SQLite can use text. Ensure all foreign-key columns match length and collation. Test Eloquent route binding, JSON serialization, model events, factories/seeders, queue serialization, and API contracts.bigint but smaller than UUID text; binary(20) saves space at the cost of cast complexity. Time-sortable inserts are better than random UUIDs but less sequential than auto-increment, so monitor index fragmentation on high-write tables.$incrementing = false, $keyType = 'string', casts, route binding, collation, and migration playbooks. A pilot table keeps organizational risk contained.How can I help you explore Laravel packages today?