laravel-uuid-model maintained by dtt
Laravel Uuid Model
Using uuid in eloquent model.
Installation
composer require dtt/laravel-uuid-model
Usage
Create primary key as string type.
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('example', function(Blueprint $table) {
$table->uuid('id')->primary();
// ...
});
}
And, Extends DT\Laravel\Uuid\Model in your model.
use DT\Laravel\Uuid\Model;
class Example extends Model
{
//...
}