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 2897c4f commit af66075Copy full SHA for af66075
src/Laravel/Eloquent/Metadata/ModelMetadata.php
@@ -67,8 +67,14 @@ public function getAttributes(Model $model): Collection
67
$table = $model->getTable();
68
$columns = $schema->getColumns($table);
69
$indexes = $schema->getIndexes($table);
70
+ $relations = $this->getRelations($model);
71
72
return collect($columns)
73
+ ->reject(
74
+ fn ($column) => $relations->contains(
75
+ fn ($relation) => $relation['foreign_key'] === $column['name']
76
+ )
77
78
->map(fn ($column) => [
79
'name' => $column['name'],
80
'type' => $column['type'],
0 commit comments