From 22376a019ba3e0c7beecf59ab21ab7026bd54e49 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Tue, 3 Dec 2024 20:11:24 +0330 Subject: [PATCH] Update CanEagerLoadTrait.php --- src/Traits/CanEagerLoadTrait.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Traits/CanEagerLoadTrait.php b/src/Traits/CanEagerLoadTrait.php index ca43d3e64..a0317e340 100644 --- a/src/Traits/CanEagerLoadTrait.php +++ b/src/Traits/CanEagerLoadTrait.php @@ -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);