<?php

namespace App\Observers;

use App\Models\Nonce;
use Ramsey\Uuid\Uuid;

class NoncesObserver
{
    public function creating(Nonce $nonce){
        if(!isset($nonce->value)){
            $nonce->value = Uuid::uuid4()->toString();
        }
        return $nonce;
    }
}
