Skip to content

Commit

Permalink
Fi: incorrect logic in PR #75 merge
Browse files Browse the repository at this point in the history
Sorry about the incorrect logic on the previous PR #75. The logic has now been corrected so that the columns, mutators, and relationships will be properly overridden by custom interfaces.
  • Loading branch information
starter-dev committed Jul 8, 2024
1 parent 88c99b9 commit 6a82ce6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Actions/BuildModelDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,16 @@ private function getModelDetails(SplFileInfo $modelFile, bool $resolveAbstract):

private function overrideCollectionWithInterfaces(Collection $columns, Collection $interfaces): Collection
{
return $columns->map(function ($column) use ($interfaces) {
$interfaces->each(function ($interface, $key) use (&$column, $interfaces) {
if ($key === $column['name']) {
$column['type'] = $interface['type'];
$column['forceType'] = true;
return $columns->filter(function ($column) use ($interfaces) {
$includeColumn = true;

$interfaces->forget($key);
$interfaces->each(function ($interface, $key) use ($column, &$includeColumn) {
if ($key === $column['name']) {
$includeColumn = false;
}
});

return $column;
return $includeColumn;
});
}
}

0 comments on commit 6a82ce6

Please sign in to comment.