Teren-app/app/Traits/Uuid.php
2025-11-06 21:54:07 +01:00

17 lines
253 B
PHP

<?php
namespace App\Traits;
use Illuminate\Support\Str;
trait Uuid
{
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->uuid = (string) Str::uuid();
});
}
}