protected function persist($name, array $attributes = [])
    {
        $entity = $this->build($name, $attributes);

        $this->assignRelationships($entity, $attributes);
        $this->model->save($entity);

        return $entity;
    }
protected function persist($name, array $attributes = [])
    {
        $entity = $this->build($name, $attributes);

        $this->assignRelationships($entity, $attributes);
        $this->model->save($entity);

        return $entity;
    }
protected function persist ( $ name , array $ attributes = [ ] ) { $ entity = $ this -> build ( $ name , $ attributes ) ; $ this -> assignRelationships ( $ entity , $ attributes ) ; $ this -> model -> save ( $ entity ) ; return $ entity ; }
Persist the entity and any relationships.

@param  string $name
@param  array  $attributes
@return mixed
Persist the entity and any relationships .