Example #1
0
 protected static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->{$model->getKeyName()} = LaraFlake::generateID();
     });
 }
Example #2
0
 public function testIdGenerator()
 {
     $id = LaraFlake::generateID();
     $this->assertNotEmpty($id);
 }