/**
* Creates and saves a model.
*
* @param string $name The model definition name.
* @param array $attr The model attributes.
*
* @return object
*/
public function create($name, array $attr = [])
{
$model = $this->make($name, $attr, true);
$this->store->persist($model);
if ($this->triggerCallback($model, $name)) {
$this->store->persist($model);
}
return $model;
}