Explorar o código

fix(apiResourceModel/relations)[ISSUE-321]: added `load` for relations in factory->create, which not loaded when models was created (if factory methods might be wrong)

pallam %!s(int64=3) %!d(string=hai) anos
pai
achega
35220fa14c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Extracting/Strategies/Responses/UseApiResourceTags.php

+ 1 - 1
src/Extracting/Strategies/Responses/UseApiResourceTags.php

@@ -203,7 +203,7 @@ class UseApiResourceTags extends Strategy
             $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);