diff --git a/README.md b/README.md index 05f296b..4da59cf 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,21 @@ class Book extends Model } ``` +The above example works for the column `id`. If you use custom name for UUID column, you need to define it: + +```php +use Illuminate\Database\Eloquent\Model; +use Verbanent\Uuid\Traits\BinaryUuidSupportableTrait; + +class Book extends Model +{ + use BinaryUuidSupportableTrait; + + protected $primaryKey = 'uuid'; + protected $fillable = ['uuid']; +} +``` + #### Abstract model for model with UUID For your convenience you can extend your model with _AbstractModel_: @@ -70,6 +85,18 @@ class Lang extends AbstractModel } ``` +The above example works for the column `id`. If you use custom name for UUID column, you need to define it: + +```php +use Verbanent\Uuid\AbstractModel; + +class Lang extends AbstractModel +{ + protected $primaryKey = 'uuid'; + protected $fillable = ['uuid']; +} +``` + #### Foreign binary UUID If you would like to use UUID as a foreign key, use another trait and set _$uuidable_ property for this model: diff --git a/docker/xdebug-local.ini b/docker/xdebug-local.ini deleted file mode 100644 index b2db12b..0000000 --- a/docker/xdebug-local.ini +++ /dev/null @@ -1 +0,0 @@ -xdebug.mode=coverage \ No newline at end of file