This commit is contained in:
2026-05-01 23:40:14 +08:00
commit b8f599a617
3867 changed files with 478663 additions and 0 deletions
@@ -0,0 +1,31 @@
<?php
namespace Illuminate\Database\Eloquent\Concerns;
use Illuminate\Support\Str;
trait HasUuids
{
use HasUniqueStringIds;
/**
* Generate a new unique key for the model.
*
* @return string
*/
public function newUniqueId()
{
return (string) Str::uuid7();
}
/**
* Determine if given key is valid.
*
* @param mixed $value
* @return bool
*/
protected function isValidUniqueId($value): bool
{
return Str::isUuid($value);
}
}