/**
  * Attaches a relationship to the model
  *
  * @param String $relationshipName Name of relationship in request
  * @param Model  $model            Model that has the relationships
  * @param mixed  $relationshipData Model(s) to associate
  *
  * @return Model
  */
 public function attachRelationship($relationshipName, Model $model, $relationshipData)
 {
     if ($relationshipName === 'success') {
         $model->successPipeable()->associate($relationshipData);
     }
     if ($relationshipName === 'failure') {
         $model->failurePipeable()->associate($relationshipData);
     }
     $model->save();
     return $model;
 }