Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Snowflake

Laravel Snowflake Laravel Package

dive-be/laravel-snowflake

dive-be/laravel-snowflake brings Snowflake ID generation to Laravel Eloquent models, creating unique, time-sortable 64-bit identifiers without auto-increment. It supports model keys and distributed systems, helping apps scale across workers and databases.

View on GitHub
Deep Wiki
Context7

Generate identifiers using Twitter Snowflake

Frequently asked questions about Laravel Snowflake
What is dive-be/laravel-snowflake used for?
It generates Twitter Snowflake identifiers for Laravel Eloquent models, giving unique, time-sortable 64-bit IDs instead of auto-increment keys. It suits distributed applications where IDs must be created across workers or services. Use it where you need compact sortable keys and Laravel-native model integration.
How do I install dive-be/laravel-snowflake in a Laravel app?
Install it with Composer using composer require dive-be/laravel-snowflake, then follow the README to wire Snowflake ID generation into your Eloquent models. For version 1.3.0, your app should run PHP 8.3 and Laravel 11. After changing constraints, clear Laravel caches and run your test suite.
Which Laravel and PHP versions does laravel-snowflake 1.3.0 support?
Release 1.3.0 adds support for PHP 8.3 and Laravel 11 while removing support for PHP 8.2 and Laravel 10. Treat it as incompatible with Laravel 10 or PHP 8.2 environments unless you complete a platform upgrade. The provided release information confirms Laravel 11 but does not confirm Laravel 12 support.
Can I use laravel-snowflake with Laravel 10 or PHP 8.2?
No, 1.3.0 drops Laravel 10 and PHP 8.2 support. If you cannot upgrade the platform yet, pin to the latest compatible 1.2.x release and confirm its support and security window. Plan a coordinated PHP 8.3 and Laravel 11 upgrade before moving to 1.3.0.
Is upgrading from 1.2.x to 1.3.0 a breaking change?
It is a compatibility-boundary release: it adds PHP 8.3 and Laravel 11 support and removes PHP 8.2 and Laravel 10. Treat it as breaking for any environment still on the removed versions even though the package's public API is reported unchanged. The notes do not confirm whether there are code-level breaking changes, so review the changelog and test before rollout.
How should I migrate an existing Laravel app to laravel-snowflake 1.3.0?
Inventory Composer constraints and run composer why-not dive-be/laravel-snowflake 1.3.0 to find blockers. Upgrade PHP to 8.3 and Laravel to 11 first where needed, then update the package and run application and package tests. Use a branch, CI on PHP 8.3 and Laravel 11, staging or canary validation, and a documented rollback pin.
Does laravel-snowflake work for distributed systems and multiple workers?
Yes, Snowflake IDs are designed for distributed generation and the package is aimed at distributed Laravel applications. Ensure each worker or node has a unique identifier as configured by the package, because collisions are the main production risk with Snowflake-style IDs. Validate generation across your deployment topology before scaling out.
What database column type should I use for Snowflake IDs in Eloquent?
Snowflake IDs are 64-bit integers, so use a 64-bit integer primary key column such as Laravel's bigInteger rather than an auto-incrementing column. Configure your Eloquent model's key type and casting according to the package README. If you are migrating existing auto-increment tables, plan schema and foreign-key changes carefully.
How do I test a Laravel app that uses Snowflake IDs?
Test model creation, ID uniqueness, time ordering, and database column compatibility in your application suite. In CI for 1.3.0, run against PHP 8.3 and Laravel 11; keep a separate matrix for 1.2.x if you still support Laravel 10 or PHP 8.2. Also test Composer resolution to catch transitive dependency conflicts early.
What are alternatives to laravel-snowflake for Laravel Eloquent IDs?
Alternatives include database auto-increment keys, UUIDs, ULIDs, and other Snowflake ID packages. Choose based on whether you need 64-bit time-sortable IDs, distributed generation, or simpler string identifiers. If you stay with Snowflake, compare packages on Laravel 11 and PHP 8.3 support, maintenance activity, and worker-ID configuration.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect