cline / strongly-typed-id
Strongly-typed ID value objects for PHP with support for UUID, ULID, NanoID, GUID, Sqid, Hashids and Laravel integration
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/strongly-typed-id
Requires
- php: ^8.4
- spatie/laravel-data: ^4.17.1
- spatie/laravel-package-tools: ^1.92.7
Requires (Dev)
- cline/php-cs-fixer: ^1.0
- driftingly/rector-laravel: ^2.0.7
- ergebnis/composer-normalize: ^2.48.2
- larastan/larastan: >=3.7.2
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.1.1
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: >=1.4.3
- phpstan/phpstan: >=2.1.30
- phpstan/phpstan-strict-rules: ^2.0.7
- rector/rector: ^2.1.7
README
This library provides strongly-typed ID value objects for PHP 8.4+, designed to create type-safe entity identifiers with support for multiple ID generation strategies including UUID variants (v1, v3, v4, v5, v6, v7, v8), ULID, NanoID, GUID, Sqid, and Hashids.
Requirements
Requires PHP 8.4+
Installation
composer require cline/strongly-typed-id
Documentation
- Basic Usage - Creating and using strongly-typed IDs
- UUID Variants - Comprehensive guide to UUID versions v1-v8
- ULID Usage - Working with ULIDs for better sortability
- NanoID Usage - Compact, secure, URL-friendly IDs
- GUID Usage - Using GUIDs for Windows/.NET compatibility
- Sqid Usage - Short, unique, URL-safe identifiers
- Hashids Usage - Obfuscated short IDs with salt configuration
- Laravel Integration - Eloquent, casts, relationships, and Spatie Laravel Data
- Advanced Patterns - DDD, CQRS, event sourcing, and multi-tenancy
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
Credits
License
The MIT License. Please see License File for more information.