PHP code example of ufucms / laravel-snowflake

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

    

ufucms / laravel-snowflake example snippets

 php
use Ufucms\Snowflake\Snowflake;

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

$id = $snowflake->nextId();

$id = $snowflake->id();

$id = Snowflake::nextId();
 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