Skip to content

Commit

Permalink
refresh model after factory create to include database-generated values
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy012 committed Oct 19, 2023
1 parent 46b5a25 commit 2895e47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Extracting/InstantiatesExampleModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 2895e47

Please sign in to comment.