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 2d59c63 commit 192e679Copy full SHA for 192e679
src/Laravel/Eloquent/Metadata/ModelMetadata.php
@@ -67,9 +67,15 @@ 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)
- ->map(fn ($column) => [
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'],
81
'increments' => $column['auto_increment'],
0 commit comments