bradietilley / php-snowflake
Snowflake ID Generator for PHP with optional Laravel integration
v2.0.0
2026-07-22 14:08 UTC
Requires
- php: ^8.4
Requires (Dev)
- laravel/pint: ^1.19
- orchestra/testbench: ^11.0
- pestphp/pest: ^3.7
- phpstan/phpstan: ^2.1
- spatie/laravel-package-tools: ^1.16
- symfony/var-dumper: ^7.2
Suggests
- illuminate/cache: Required to use the LaravelSequenceResolver for cache-based concurrency (^13.0)
- illuminate/database: Required to use the HasSnowflake Eloquent trait (^13.0)
- illuminate/support: Required to use the Laravel service provider and configuration (^13.0)
- spatie/laravel-package-tools: Required to boot the Laravel service provider (^1.16)
README
Snowflake IDs in PHP, with optional first-class Laravel integration.
Documentation
Full documentation is available at bradietilley.dev/php-snowflake.
Installation
composer require bradietilley/php-snowflake
use BradieTilley\Snowflake\Snowflake; Snowflake::configure('2025-01-01 00:00:00', cluster: 1, worker: 1); echo Snowflake::id(); // 9048372019229466888
See the documentation for configuration, concurrency, testing, and Laravel integration.