diff --git a/src/Factory.php b/src/Factory.php index 7701551..c39d48a 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -334,11 +334,7 @@ private function make($model, array $attr, $save) } // Get the factory attributes for that model - $attributes = $this->attributesFor($object, $attr); - - foreach ($attributes as $name => $value) { - $this->setAttribute($object, $name, $value); - } + $this->attributesFor($object, $attr); return $object; } @@ -579,6 +575,7 @@ public function attributesFor($object, array $attr = array()) // Prepare attributes foreach ($attributes as $key => $kind) { $attr[$key] = $this->generateAttr($kind, $object); + $this->setAttribute($object, $key, $attr[$key]); } return $attr;