PHP code example of wavpa / snowflake

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

    

wavpa / snowflake example snippets


use Wavpa\Snowflake\Snowflake;

$snowflake = new Snowflake();

$id = $snowflake->nextId();
// 412471893908520960

public function nextId(Request $request, Snowflake $snowflake)
{
    return $snowflake->nextId();
}

public function nextId(Request $request)
{
    return app('snowflake')->nextId();
}