Example of Ramsey/uuid in devhub-az/devhub

File app/Observers/UserObserver.php (link to Github)
use App\Models\User;
use Ramsey\Uuid\Uuid;

class UserObserver
{
    public function creating(User $user)
    {
        $user->id = Uuid::uuid4();
    }
}

Additional resources on ramsey/uuid: