mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
Migrated to UUID v4
This commit is contained in:
20
app/Models/Concerns/HasUuids.php
Normal file
20
app/Models/Concerns/HasUuids.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models\Concerns;
|
||||
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
trait HasUuids
|
||||
{
|
||||
use \Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
|
||||
/**
|
||||
* Generate a new UUID for the model.
|
||||
*/
|
||||
public function newUniqueId(): string
|
||||
{
|
||||
return (string) Uuid::uuid4();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user