Download the PHP package reishou/unique-identity without Composer
On this page you can find all versions of the php package reishou/unique-identity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download reishou/unique-identity
More information about reishou/unique-identity
Files in reishou/unique-identity
Package unique-identity
Short Description Generator unique identity 64 bits and combine with laravel eloquent.
License MIT
Informations about the package unique-identity
unique-identity
Generator unique identity 64 bits and combine with laravel eloquent.
- Overview
- Installation
- Usage
- Automatic when eloquent boot creating
- Manual generate list uid
- License
- Changelog
Overview
This project inspires from the article Sharding & IDs at Instagram. With it, you can create uid for your table:
- 64-bits length.
- sortable by time.
Installation
Require this package with composer using the following command:
Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
Publish the config file with:
You can change entity_table
name in config/uid.php
(default entity_sequences
).
Then run command generate migration:
After the migration has been generated you can create the entity_table
by running:
Usage
Automatic when eloquent boot creating
Your Eloquent models should use the Reishou\UniqueIdentity\HasUid
trait.
The primaryKey
will be filled auto by uid generator when model created or saved for the first time.
Manual generate list uid
You can generate multi uid for multi record before inserting to database.
License
The MIT License (MIT). Please see LICENSE for more information.
Changelog
Please see CHANGELOG for more information on what has changed recently.