1. Go to this page and download the library: Download septech-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/ */
septech-laravel / snowflake example snippets
composer c config
php artisan vendor:publish --provider="Septech\\Snowflake\\SnowflakeServiceProvider"
use Septech\Snowflake\Facades\Snowflake;
Snowflake::next(); // Alias for id()
Snowflake::id();
Snowflake::parseId('6696174721395998720');
// -- routes/api.php
use Septech\Snowflake\Facades\Snowflake;
Snowflake::routes();
use Septech\Snowflake\Facades\Snowflake;
Route::group(['prefix' => '/snowflake'], function () {
Snowflake::routes();
});
Route::group(['middleware' => \Septech\Snowflake\Http\Middleware\ServerToken::class], function () {
Snowflake::routes();
});