PHP code example of coder-orbit / unique-id-generator

1. Go to this page and download the library: Download coder-orbit/unique-id-generator 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/ */

    

coder-orbit / unique-id-generator example snippets


    use CoderOrbit\LaravelUniqueId\UniqueId;
 copy

// @Parameter

// $model_name
// $field_name

$data = UniqueId::uniqueNumber(User::class, "unique_id");
dd($data);
// 6629289017
 copy

// $model_name
// $field_name
// $length is limit for use max number is 18, defalut 10
$data = UniqueId::uniqueNumber(User::class, "unique_id", 5);
dd($data);
// 66292
 copy

// $model_name
// $field_name

$data = UniqueId::uniqueId(User::class, "unique_id");
dd($data);
// ZqMkPpjXrOeOq1z

 copy

// $model_name
// $field_name
// $length

$data = UniqueId::uniqueId(User::class, "unique_id", 5);
dd($data);
// B2czT