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

Commit b21c790

Browse files
committed
Update README
1 parent e491640 commit b21c790

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TestModel extends Model
4848
}
4949
```
5050

51-
If don't like the primary key named `uuid` you can manually specify `$primaryKey`. Don't forget set `$incrementing` to false.
51+
If don't like the primary key named `uuid` you can manually specify the `getKeyName` method. Don't forget set `$incrementing` to false.
5252

5353
```php
5454
use Illuminate\Database\Eloquent\Model;
@@ -60,7 +60,10 @@ class TestModel extends Model
6060

6161
public $incrementing = false;
6262

63-
public $primaryKey = 'uuid';
63+
public function getKeyName()
64+
{
65+
return 'custom_uuid';
66+
}
6467
}
6568
```
6669

0 commit comments

Comments
 (0)