Skip to content

Commit 47a45bd

Browse files
Merge pull request #12 from verbanent/update/readme
Updated README.md file
2 parents ff4edb8 + bc92f7c commit 47a45bd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ class Book extends Model
5757
}
5858
```
5959

60+
The above example works for the column `id`. If you use custom name for UUID column, you need to define it:
61+
62+
```php
63+
use Illuminate\Database\Eloquent\Model;
64+
use Verbanent\Uuid\Traits\BinaryUuidSupportableTrait;
65+
66+
class Book extends Model
67+
{
68+
use BinaryUuidSupportableTrait;
69+
70+
protected $primaryKey = 'uuid';
71+
protected $fillable = ['uuid'];
72+
}
73+
```
74+
6075
#### Abstract model for model with UUID
6176

6277
For your convenience you can extend your model with _AbstractModel_:
@@ -70,6 +85,18 @@ class Lang extends AbstractModel
7085
}
7186
```
7287

88+
The above example works for the column `id`. If you use custom name for UUID column, you need to define it:
89+
90+
```php
91+
use Verbanent\Uuid\AbstractModel;
92+
93+
class Lang extends AbstractModel
94+
{
95+
protected $primaryKey = 'uuid';
96+
protected $fillable = ['uuid'];
97+
}
98+
```
99+
73100
#### Foreign binary UUID
74101

75102
If you would like to use UUID as a foreign key, use another trait and set _$uuidable_ property for this model:

docker/xdebug-local.ini

-1
This file was deleted.

0 commit comments

Comments
 (0)