defectivecode / database-uuids
Database-generated UUIDs for PHP applications.
Requires
- php: >=8.5
Requires (Dev)
- doctrine/dbal: ^4.4
- laravel/pint: ^1.32.3
- nunomaduro/collision: ^8.9.6
- orchestra/testbench: ^11.3
- phpstan/phpstan: ^2.3.7
- phpunit/phpunit: ^13.4.8
Suggests
- doctrine/dbal: Enables UUID schema integration with Doctrine DBAL 4.
- illuminate/database: Enables UUID migration macros with Laravel 13.
Provides
None
Conflicts
None
Replaces
None
README
English | العربية | বাংলা | Bosanski | Deutsch | Español | Français | हिन्दी | Italiano | 日本語 | 한국어 | मराठी | Português | Русский | Kiswahili | தமிழ் | తెలుగు | Türkçe | اردو | Tiếng Việt | 中文
Introduction
Database UUIDs lets you use a UUID primary key the way you use an auto-incrementing integer: insert a row without
an id, and the database assigns one. Define the key once in a Laravel or Doctrine migration. Inserts from Laravel's
query builder, Doctrine DBAL, import scripts, and SQL clients can share the same default by omitting id.
Key Features
- Generate a UUIDv7 primary key, or choose UUIDv1 or UUIDv4 for a primary key or another column.
- Link related records using UUID foreign keys.
- Give an imported record the same UUIDv5 each time you receive it, using values such as its source and external ID.
Example
Define customers.id with primaryUuid() in a Laravel or Doctrine migration. Then insert a customer without supplying
an ID:
INSERT INTO customers (name) VALUES ('Jane Smith');
The database assigns a UUIDv7 regardless of which client runs the insert.
Documentation
You may read the documentation on our website.
Support Guidelines
Thanks for choosing our open source package! Please take a moment to check out these support guidelines. They'll help you get the most out of our project.
Community Driven Support
Our open-source project is fueled by our awesome community. If you have questions or need assistance, StackOverflow and other online resources are your best bets.
Bugs, and Feature Prioritization
The reality of managing an open-source project means we can't address every reported bug or feature request immediately. We prioritize issues in the following order:
1. Bugs Affecting Our Paid Products
Bugs that impact our paid products will always be our top priority. In some cases, we may only address bugs that affect us directly.
2. Community Pull Requests
If you've identified a bug and have a solution, please submit a pull request. After issues affecting our products, we give the next highest priority to these community-driven fixes. Once reviewed and approved, we'll merge your solution and credit your contribution.
3. Financial Support
For issues outside the mentioned categories, you can opt to fund their resolution. Each open issue is linked to an order form where you can contribute financially. We prioritize these issues based on the funding amount provided.
Community Contributions
Open source thrives when its community is active. Even if you're not fixing bugs, consider contributing through code improvements, documentation updates, tutorials, or by assisting others in community channels. We highly encourage everyone, as a community, to help support open-source work. See the contributing guide for development setup and checks.
To reiterate, DefectiveCode will prioritize bugs based on how they impact our paid products, community pull requests, and the financial support received for issues.
License
The MIT License (MIT). Please see License File for more information.