Skip to content

Commit

Permalink
Update CanEagerLoadTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Dec 3, 2024
1 parent e774882 commit 22376a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Traits/CanEagerLoadTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ protected function eagerLoadRequestedRelations(): void
$this->scopeQuery(function (Builder|Model $model) {
if (request()?->has(config('fractal.auto_includes.request_key'))) {
$validIncludes = [];
// TODO: Do we need to do the same for the excludes?
// TODO: Or default includes! Are they eager loaded by default?
foreach (Response::getRequestedIncludesAsModelRelation() as $includeName) {
$relationParts = explode('.', $includeName);
$camelCasedIncludeName = $this->filterInvalidRelations($this->model, $relationParts);
Expand Down

0 comments on commit 22376a0

Please sign in to comment.