Skip to content

Commit

Permalink
Update README.md (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin authored Aug 20, 2021
1 parent 9139590 commit dde045c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,26 @@ class Currency extends Model
}
```

### Handling String-based Primary Keys
Sushi requires you to add two properties to your model, if it uses a string-based primary key - `$incrementing` and `$keyType`:

```php
class Role extends Model
{
use \Sushi\Sushi;

public $incrementing = false;

protected $keyType = 'string';

protected $rows = [
['id' => 'admin', 'label' => 'Admin'],
['id' => 'manager', 'label' => 'Manager'],
['id' => 'user', 'label' => 'User'],
];
}
```

### Troubleshoot

**ERROR:** `SQLSTATE[HY000]: General error: 1 too many SQL variables`
Expand Down

0 comments on commit dde045c

Please sign in to comment.