Skip to content

Commit 453af86

Browse files
authored
Merge pull request #77 from starter-dev/patch-3
Fix: incorrect logic in PR #75 merge
2 parents 88c99b9 + 6a82ce6 commit 453af86

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Actions/BuildModelDetails.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,16 @@ private function getModelDetails(SplFileInfo $modelFile, bool $resolveAbstract):
103103

104104
private function overrideCollectionWithInterfaces(Collection $columns, Collection $interfaces): Collection
105105
{
106-
return $columns->map(function ($column) use ($interfaces) {
107-
$interfaces->each(function ($interface, $key) use (&$column, $interfaces) {
108-
if ($key === $column['name']) {
109-
$column['type'] = $interface['type'];
110-
$column['forceType'] = true;
106+
return $columns->filter(function ($column) use ($interfaces) {
107+
$includeColumn = true;
111108

112-
$interfaces->forget($key);
109+
$interfaces->each(function ($interface, $key) use ($column, &$includeColumn) {
110+
if ($key === $column['name']) {
111+
$includeColumn = false;
113112
}
114113
});
115114

116-
return $column;
115+
return $includeColumn;
117116
});
118117
}
119118
}

0 commit comments

Comments
 (0)