xzxzyzyz/laravel-uuid-model

Uuid Model For Laravel

v1.7.0 2024-04-01 08:03 UTC

This package is auto-updated.

Last update: 2024-12-01 00:14:32 UTC


README

Build Status Latest Stable Version License

Using uuid in eloquent model.

Installation

composer require xzxzyzyz/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 Xzxzyzyz\Laravel\Uuid\Model in your model.

use Xzxzyzyz\Laravel\Uuid\Model;

class Example extends Model
{
	//...
}