Skip to content

Commit

Permalink
fix(apiResourceModel/relations)[ISSUE-321]: added load for relation…
Browse files Browse the repository at this point in the history
…s in factory->create, which not loaded when models was created (if factory methods might be wrong)
  • Loading branch information
090809 committed Jan 30, 2022
1 parent 8255f77 commit 35220fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Extracting/Strategies/Responses/UseApiResourceTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected function instantiateApiResourceModel(string $type, array $factoryState
$factory = Utils::getModelFactory($type, $factoryStates, $relations);

try {
return $factory->create();
return $factory->create()->load($relations);
} catch (Throwable $e) {
c::warn("Eloquent model factory failed to create {$type}; trying to make it.");
e::dumpExceptionIfVerbose($e, true);
Expand Down

0 comments on commit 35220fa

Please sign in to comment.