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 0624f5fCopy full SHA for 0624f5f
src/Laravel/Eloquent/Metadata/ModelMetadata.php
@@ -106,7 +106,7 @@ public function getAttributes(Model $model): Collection
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