PHP code example of laragrad / uuid

1. Go to this page and download the library: Download laragrad/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/ */

    

laragrad / uuid example snippets


use /Laragrad/Uuid/Models/Concerns/HasUuidPrimaryKey;

class MyModel extends Model
{
	use HasUuidPrimaryKey
	
	public $appCode = 0x002;

	public $entityCode = 0x000F;

}


$uuid = gen_uuid(0xF,0x2);
echo $uuid; // 622235ea-8e54-f002-000f-742c8deebf77

$uuid = gen_uuid(0xF,0x2);
echo get_uuid_timestamp($uuid', 'Y-m-d H:i:s.u');
// 2022-03-04 19:00:39.906514

$uuid = gen_uuid(0xF,0x2);
echo get_uuid_app_code($uuid');
// 2

$uuid = gen_uuid(0xF,0x2);
echo get_uuid_entity_code($uuid');
// 15