Skip to content

Commit

Permalink
Merge pull request #419 from 090809/fix-321-added-load-missing-for-cr…
Browse files Browse the repository at this point in the history
…eated-relations

fix[ISSUE-321]: added `load` for relations in factory->create
  • Loading branch information
shalvah authored Jan 31, 2022
2 parents 8255f77 + 35220fa commit f45ad07
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 f45ad07

Please sign in to comment.