We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a1a1ea commit d51cddbCopy full SHA for d51cddb
src/Laravel/Eloquent/Metadata/ModelMetadata.php
@@ -101,12 +101,12 @@ public function getAttributes(Model $model): Collection
101
}
102
103
/**
104
- * @param array<int, array{columns: string[]}> $indexes
+ * @param array<int, array{columns: string[], primary?: bool}> $indexes
105
*/
106
private function isColumnPrimaryKey(array $indexes, string $column): bool
107
{
108
foreach ($indexes as $index) {
109
- if (\in_array($column, $index['columns'], true)) {
+ if (\in_array($column, $index['columns'], true) && (true === ($index['primary'] ?? false))) {
110
return true;
111
112
0 commit comments