dtt / laravel-uuid-model
Uuid Model For Laravel
2.1.3
2023-05-16 04:12 UTC
Requires
- php: >=7.1.3
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^3.6
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2025-06-16 08:55:14 UTC
README
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 { //... }