PHP code example of kra8 / laravel-snowflake

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

    

kra8 / laravel-snowflake example snippets

 php
$snowflake = $this->app->make('Kra8\Snowflake\Snowflake');
 php
$snowflake = app('Kra8\Snowflake\Snowflake');

$id = $snowflake->next();
 php
/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->id();
        $table->string('name');
        $table->string('email')->unique();
        $table->string('password');
        $table->rememberToken();
        $table->timestamps();
    });
}

php artisan vendor:publish