PHP code example of hafael / laraflake

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

    

hafael / laraflake example snippets


'providers' => [
    /*
     * Application Service Providers...
     */
    ...
    Hafael\LaraFlake\LaraFlakeServiceProvider::class,
],

class User extends Authenticatable
{
    use LaraFlakeTrait;
    protected $table = "users";
    
    /**
     * Indicates if the IDs are auto-incrementing.
     * @var bool
     */
    public $incrementing = false;
    ...

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            
            $table->bigInteger('id')->unsigned()->primary();
            
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }
    ...