Files
backend/src/app/Models/Concerns/HasUuid.php
T
bastien d95bfa6c58
Laverie/backend/pipeline/head There was a failure building this commit
Jenkins file
2026-07-04 22:42:58 +02:00

18 lines
311 B
PHP

<?php
namespace App\Models\Concerns;
use Illuminate\Support\Str;
trait HasUuid
{
protected static function bootHasUuid(): void
{
static::creating(function ($model) {
if (empty($model->uuid)) {
$model->uuid = (string) Str::uuid();
}
});
}
}