You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
348 B
20 lines
348 B
<?php
|
|
|
|
namespace App\Domains\System\Traits\Model;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
trait HasPublicUlid
|
|
{
|
|
public static function bootHasPublicUlid(): void
|
|
{
|
|
static::creating(function ($model) {
|
|
$model->ulid = Str::ulid();
|
|
});
|
|
}
|
|
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return 'ulid';
|
|
}
|
|
}
|
|
|