lasthourcloud/app/Models/BaseModel.php
Andras Bacsai 1c259fe12e fix: shorter cuids (7)
feat: show deployments
2023-03-29 12:52:22 +02:00

19 lines
324 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Visus\Cuid2\Cuid2;
abstract class BaseModel extends Model
{
protected static function boot()
{
parent::boot();
static::creating(function (Model $model) {
$model->uuid = (string) new Cuid2(7);
});
}
}