From 26a70c2bf22d465d72dec9df990beb9d6da02f62 Mon Sep 17 00:00:00 2001 From: Florian Schmidt Date: Fri, 20 Oct 2023 01:01:53 +0200 Subject: [PATCH] refresh model after factory create to include database-generated values (#753) --- 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 537a01cc..47000ea6 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); + return $factory->create()->load($relations)->refresh(); } /**