PHPackages                             haritsyp/laravel-snowflake - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. haritsyp/laravel-snowflake

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

haritsyp/laravel-snowflake
==========================

Snowflake for laravel

061↓86.7%PHP

Since Oct 9Pushed 8mo agoCompare

[ Source](https://github.com/haritsyp/laravel-snowflake)[ Packagist](https://packagist.org/packages/haritsyp/laravel-snowflake)[ RSS](/packages/haritsyp-laravel-snowflake/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Haritsyp\\Snowflake
===================

[](#haritsypsnowflake)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1993c9894a8433693416cab44fb0998f7b13a1932d23b543e0be3430600fad16/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d312e302d627269676874677265656e)](https://packagist.org/packages/haritsyp/laravel-snowflake)[![Software License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE.md)

Snowflake ID generator for Laravel, supports int64 &amp; Base62.

Install
-------

[](#install)

In your terminal:

```
# install the package
composer require haritsyp/laravel-snowflake
```

- if you are using laravel &lt;= 5.5, add the following snippet to the config/app.php file under the providers section as follows:

```
// Add this line
'providers' => [
    // Laravel default providers
    App\Providers\AppServiceProvider::class,
    // ...

    Haritsyp\Snowflake\SnowflakeServiceProvider::class,
],
```

Usage: Trait in Models
======================

[](#usage-trait-in-models)

- Add the UsesSnowflake trait to any Eloquent model to automatically generate IDs:

```
