PHPackages                             kduma/eloquent-snowflakeable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. kduma/eloquent-snowflakeable

ActiveLibrary[Database &amp; ORM](/categories/database)

kduma/eloquent-snowflakeable
============================

Eases using and generating SnowFlake ID's in Laravel Eloquent models.

00PHP

Since Dec 29Pushed 2y agoCompare

[ Source](https://github.com/kduma-OSS/LV-eloquent-snowflakeable)[ Packagist](https://packagist.org/packages/kduma/eloquent-snowflakeable)[ RSS](/packages/kduma-eloquent-snowflakeable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LV-eloquent-snowflakeable
=========================

[](#lv-eloquent-snowflakeable)

[![Latest Stable Version](https://camo.githubusercontent.com/46c40b42eff595ac6e3243be5afd5c03f0b6dbeaf6b572762d940a4c7dbde89a/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d736e6f77666c616b6561626c652f762f737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-snowflakeable)[![Total Downloads](https://camo.githubusercontent.com/5c7a34354035f6aff4b01e6fd4a9ca254cb2d14a66a96e65a84676ad4c73b16b/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d736e6f77666c616b6561626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/kduma/eloquent-snowflakeable)[![Latest Unstable Version](https://camo.githubusercontent.com/74e03fc94aac216d3ed5e4936bf1a365fb8b301ae34f1fde8c6bf64cfb8bfccd/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d736e6f77666c616b6561626c652f762f756e737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-snowflakeable)[![License](https://camo.githubusercontent.com/c94cad482042955dab87047cf1d91d2ac83846b4a3fa3cf98879c7c6441478b6/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d736e6f77666c616b6561626c652f6c6963656e73652e737667)](https://packagist.org/packages/kduma/eloquent-snowflakeable)

Eases using and generating SnowFlake ID's in Laravel Eloquent models.

Setup
=====

[](#setup)

Install it using composer

```
composer require kduma/eloquent-snowflakeable

```

Prepare models
==============

[](#prepare-models)

Inside your model (not on top of file) add following lines:

```
use \KDuma\Eloquent\Snowflakeable;

```

In database create `ulid` string field. If you use migrations, you can use following snippet:

```
$table->unsignedBigInteger('sfid')->unique();

```

Usage
=====

[](#usage)

By default, it generates snowflake id on first save.

- `$model->regenerateSnowflake()` - Generate new snowflake id. (Remember to save it by yourself)
- `Model::whereSnowflake($id)->first()` - Find by snowflake id. (`whereSnowflake` is query scope)
- `Model::bySnowflake($id)` - Find by snowflake id.
- `$model->snowflake` - Gets `ParsedSnowflake` object.
- `$model->snowflake->getDateTime()` - Gets `Carbon` object with snowflake creation time.

Packagist
=========

[](#packagist)

View this package on Packagist.org: [kduma/eloquent-snowflakeable](https://packagist.org/packages/kduma/eloquent-snowflakeable)

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09451622719c7efce1a7971b8e5a875859504882ba2b8c279d1015a99e8f12c?d=identicon)[kduma](/maintainers/kduma)

---

Top Contributors

[![kduma](https://avatars.githubusercontent.com/u/1062582?v=4)](https://github.com/kduma "kduma (30 commits)")

---

Tags

laravelphp

### Embed Badge

![Health badge](/badges/kduma-eloquent-snowflakeable/health.svg)

```
[![Health](https://phpackages.com/badges/kduma-eloquent-snowflakeable/health.svg)](https://phpackages.com/packages/kduma-eloquent-snowflakeable)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
