2023-03-24 13:54:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2023-03-24 15:56:56 +00:00
|
|
|
use Visus\Cuid2\Cuid2;
|
2023-03-24 13:54:17 +00:00
|
|
|
|
|
|
|
abstract class BaseModel extends Model
|
|
|
|
{
|
|
|
|
protected static function boot()
|
|
|
|
{
|
|
|
|
parent::boot();
|
|
|
|
|
|
|
|
static::creating(function (Model $model) {
|
2023-03-29 10:52:22 +00:00
|
|
|
$model->uuid = (string) new Cuid2(7);
|
2023-03-24 13:54:17 +00:00
|
|
|
});
|
|
|
|
}
|
2023-03-24 15:56:56 +00:00
|
|
|
}
|