xzxzyzyz / laravel-uuid-model
Uuid Model For Laravel
v1.9.0
2026-03-18 02:55 UTC
Requires
- php: ^8.2
- illuminate/config: ^10.0|^11.0|^12.0|^13.0
- illuminate/database: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- ramsey/uuid: ^4.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^8.0|^9.6|^10.0|^11.0
- phpunit/phpunit: ^9.5|^10.5|^11.0
README
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 { //... }