In this post we’ll take a look at a .

## Problem

The problem is simple enough… how do you automatically generate a uuid without going into the math complexity.

/**
*  Setup model event hooks
*/
public static function boot()
{
parent::boot();
self::creating(function ($model) {$model->uuid = (string) Uuid::generate(4);
});
}