From 74477fe7bc499de751e870f101a9505364ed08dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Dijoux?= Date: Tue, 15 Oct 2024 18:35:01 +0200 Subject: [PATCH] Fix issue with model relations being lost after refresh in getExampleModelFromFactoryCreate --- src/Extracting/InstantiatesExampleModels.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extracting/InstantiatesExampleModels.php b/src/Extracting/InstantiatesExampleModels.php index 47000ea6..8a73fabd 100644 --- a/src/Extracting/InstantiatesExampleModels.php +++ b/src/Extracting/InstantiatesExampleModels.php @@ -69,7 +69,7 @@ protected function instantiateExampleModel( protected function getExampleModelFromFactoryCreate(string $type, array $factoryStates = [], array $relations = []) { $factory = Utils::getModelFactory($type, $factoryStates, $relations); - return $factory->create()->load($relations)->refresh(); + return $factory->create()->refresh()->load($relations); } /**