wearealgomas / uid
A handy package to generate unique identifiers for Eloquent models
Installs: 7 934
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: ^7.3
- hashids/hashids: ^4.0
- illuminate/container: >=7.0
- illuminate/database: >=7.0
- illuminate/support: >=7.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2020-04-25 11:46:22 UTC
README
A handy little Laravel compatible package that creates unique identifiers like u5CVsCnxyXg
for your Eloquent models.
Installation
Require this package
composer require ollico/uid
Usage
Configuration
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
uid
during thecreating
event
Good to know
We utilise HashIds under the hood.