PHPackages                             jetcod/eloquent-keygen - 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. jetcod/eloquent-keygen

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

jetcod/eloquent-keygen
======================

A Laravel package providing seamless integration with Snowflake ID generation for Eloquent models

v1.1.0(1y ago)217.5k↑18.4%MITPHPPHP ^7.4|^8.0

Since Feb 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jetcod/eloquent-keygen)[ Packagist](https://packagist.org/packages/jetcod/eloquent-keygen)[ RSS](/packages/jetcod-eloquent-keygen/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Eloquent KeyGen
===============

[](#eloquent-keygen)

This is a Laravel package providing seamless integration with Snowflake ID generation for Eloquent models. Simplify primary key management with automatic generation using a highly distributed unique identifier system. Enhance your application's scalability and efficiency with this easy-to-use package for Laravel Eloquent models.

Installation
------------

[](#installation)

To install `jetcod/deloquent-keygen`, you can use Composer, the dependency manager for PHP. Run the following command in your terminal:

```
composer require jetcod/eloquent-keygen
```

Then you need to publish the config file:

```
php artisan vendor:publish --provider="eloquent-key-generator-config"
```

How to use?
-----------

[](#how-to-use)

To use the package, follow these steps:

- **Extend Your Model**:

Instead of extending Illuminate\\Database\\Eloquent\\Model, extend Jetcod\\Eloquent\\Model in your Eloquent model. This will enable automatic ID generation using the Snowflake algorithm.

```
