continuum-digital/uid
Laravel package to generate unique identifiers
1,921
| Install | |
|---|---|
composer require continuum-digital/uid |
|
| Latest Version: | 0.0.1 |
| PHP: | ^7.1 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Aug 23, 2018 |
| Links: | GitHub · Packagist |
Maintainer: davidianbonner
Continuum Agency Uid
Laravel package to create automatic unique nullable identifiers like u5CVsCnxyXg for your Eloquent models.
Installation
Require this package
composer require continuum-digital/uid
Usage
Configuration
Create a new entry in database.config.php to configure your uid's:
'uid' => [
'salt' => '', // Default ''
'minLength' => '', // Default 0
'alphabet' => '', // Default 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
],
You can remove the salt, minLength or alphabet to use default values.
Database
Add the $table->uid() in your Schemas:
Schema::create('your_table', function (Blueprint $table) {
$table->uid();
})
Eloquent
Add the HasUid trait to your Models to add the capabilities:
- Local scope
$model->uid($uid) - Automatic generation of
uidduring thecreatingevent
Notes
This package use HashIds under the hood.
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.0.1 | ^7.1 | >=5.5 | MIT |