Skip to content

Commit 6dadc78

Browse files
committed
Add README info
1 parent 2a7b7ae commit 6dadc78

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ Schema::create('test', function (Blueprint $table) {
219219
});
220220
```
221221

222+
### Increment Columns without Primary Key
223+
224+
Sometimes you may want to set a custom primary key. However if your table has an int `increment` column,
225+
Laravel, by default, always sets this column as the primary key. Even if you manually set another one. This behavior can be disabled using the `withoutPrimaryKey` method.
226+
227+
```php
228+
Schema::create('test', function (Blueprint $table) {
229+
$table->id()->withoutPrimaryKey();
230+
$table->uuid('uuid');
231+
232+
$table->primaryKey(['id', 'uuid']);
233+
});
234+
```
235+
222236
## Testing
223237

224238
Execute the tests using PHPUnit

0 commit comments

Comments
 (0)