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 8f4bc08 commit 101aa0fCopy full SHA for 101aa0f
src/Laravel/Eloquent/Metadata/ModelMetadata.php
@@ -76,8 +76,8 @@ public function getAttributes(Model $model): array
76
$columns = $schema->getColumns($table);
77
$indexes = $schema->getIndexes($table);
78
$relations = $this->getRelations($model);
79
-
80
- $foreignKeys = array_flip(array_column($relations, 'foreign_key'));
+
+ $foreignKeys = array_flip(array_filter(array_column($relations, 'foreign_key')));
81
$attributes = [];
82
83
foreach ($columns as $column) {
0 commit comments