Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 2e3c024

Browse files
committed
Revert "Remove references to deprecated trait in docs"
This reverts commit 9a09395.
1 parent 9f667b5 commit 2e3c024

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,21 @@ Schema::create('table_name', function (Blueprint $table) {
3636
});
3737
```
3838

39-
To get your model to work with the encoded UUID (i.e. to use uuid as a primary key), you must let your model use the `Spatie\BinaryUuid\HasBinaryUuid` trait.
39+
To get your model to work with the encoded UUID (i.e. to use uuid as a primary key), you must let your model use the `Spatie\BinaryUuid\HasBinaryUuid` and the `Spatie\BinaryUuid\HasUuidPrimaryKey` traits.
4040

4141
```php
4242
use Illuminate\Database\Eloquent\Model;
4343
use Spatie\BinaryUuid\HasBinaryUuid;
44+
use Spatie\BinaryUuid\HasUuidPrimaryKey;
4445

4546
class TestModel extends Model
4647
{
47-
use HasBinaryUuid;
48+
use HasBinaryUuid,
49+
HasUuidPrimaryKey;
4850
}
4951
```
5052

51-
If don't like the primary key named `uuid` you can manually specify `$primaryKey`. Don't forget set `$incrementing` to false.
53+
If don't like the primary key named `uuid` you can leave off the `HasUuidPrimaryKey` trait and manually specify `$primaryKey`. Don't forget set `$incrementing` to false.
5254

5355
```php
5456
use Illuminate\Database\Eloquent\Model;

0 commit comments

Comments
 (0)