Exemple #1
0
 /**
  * Relate a child object to this object.
  * Uses the 'relationships' polymorphic table.
  * Does not relate the objects if the relationship exists already.
  * @param Model $child
  * @return null|Relationship
  */
 public function relate(Model $child)
 {
     if (Relationship::exists($this, $child)) {
         return null;
     }
     return Relationship::relate($this, $child);
 }