Skip to content

Commit f13a4fe

Browse files
authored
Support for custom data includes in transformer
Fix dingo#1575 This is a resubmission of the pull request with proper formatting
1 parent 21092f3 commit f13a4fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Transformer/Adapter/Fractal.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ protected function mergeEagerLoads($transformer, $requestedIncludes)
197197
foreach ($includes as $key => $value) {
198198
$eagerLoads[] = is_string($key) ? $key : $value;
199199
}
200+
201+
if (property_exists($transformer, 'lazyLoadedIncludes')) {
202+
$eagerLoads = array_diff($eagerLoads, $transformer->lazyLoadedIncludes);
203+
}
200204

201205
return $eagerLoads;
202206
}

0 commit comments

Comments
 (0)