mini\uuid()
Function
Documentation
Generate a new UUID/GUID.
By default, generates a UUID v7 (time-ordered + cryptographically random). Can be customized by providing a factory implementation at:
_config/mini/UUID/FactoryInterface.php
Example Usage
$id = uuid(); // "018c8f3a-2b4e-7a1c-9f23-4d5e6f7a8b9c"
Custom Factory Example
// _config/mini/UUID/FactoryInterface.php
return new class implements \mini\UUID\FactoryInterface {
public function make(): string {
// Custom UUID generation logic
return '...';
}
};
Signature
function uuid(): string
Returns
string