PHP code example of rotrer / uuid

1. Go to this page and download the library: Download rotrer/uuid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rotrer / uuid example snippets



'providers' => [
    // ommited
    
    \Webpatser\Uuid\UuidServiceProvider::class,
]
    
'aliases' => [
    // ommited
    
    'Uuid' => Webpatser\Uuid\Uuid::class,
]

'aliases' => array(
    // ommited
    'Uuid' => 'Webpatser\Uuid\Uuid',
)

Uuid::generate()

Uuid::generate(1,'00:11:22:33:44:55');

Uuid::generate(3,'test', Uuid::NS_DNS);

Uuid::generate(4);

Uuid::generate(5,'test', Uuid::NS_DNS);

$uuid = Uuid::import('d3d29d70-1d25-11e3-8591-034165a3a613');

$uuid = Uuid::generate(1);
dd($uuid->time);

$uuid = Uuid::generate(4);
dd($uuid->version);

$uuid = Uuid::generate();
$validator = Validator::make(['uuid' => $uuid], ['uuid' => 'uuid']);
dd($validator->passes());