A handy little Laravel compatible package that creates unique identifiers like u5CVsCnxyXg
for your Eloquent models.
Require this package
composer require ollico/uid
Add the $table->uid()
in your Schemas:
Schema::create('your_table', function (Blueprint $table) {
$table->uid();
})
Add the HasUid
trait to your Models
to add the capabilities:
- Local scope
$model->uid($uid)
- Automatic generation of
uid
during thecreating
event
We utilise HashIds under the hood.