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

Commit 1b1b2a1

Browse files
authored
Merge pull request #54 from vpratfr/update-readme
Remove references to deprecated trait in README
2 parents 0396908 + 1836813 commit 1b1b2a1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,19 @@ 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` and the `Spatie\BinaryUuid\HasUuidPrimaryKey` traits.
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.
4040

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

4645
class TestModel extends Model
4746
{
48-
use HasBinaryUuid,
49-
HasUuidPrimaryKey;
47+
use HasBinaryUuid;
5048
}
5149
```
5250

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.
51+
If don't like the primary key named `uuid` you can manually specify `$primaryKey`. Don't forget set `$incrementing` to false.
5452

5553
```php
5654
use Illuminate\Database\Eloquent\Model;
@@ -99,10 +97,10 @@ In your JSON you will see `uuid` and `country_uuid` in their textual representat
9997

10098
#### A note on the `uuid` blueprint method
10199

102-
Laravel currently doesn't allow adding new blueprint methods which can be used out of the box.
100+
Laravel currently does not allow adding new blueprint methods which can be used out of the box.
103101
Because of this, we decided to override the `uuid` behaviour which will create a `BINARY` column instead of a `CHAR(36)` column.
104102

105-
There are some cases in which Laravel's generated code will also use `uuid`, but doesn't support our binary implementation.
103+
There are some cases in which Laravel's generated code will also use `uuid`, but does not support our binary implementation.
106104
An example are database notifications.
107105
To make those work, you'll have to change the migration of those notifications to use `CHAR(36)`.
108106

0 commit comments

Comments
 (0)