src/Franzose/ClosureTable/Models/Entity.php
public function appendRelation($relation, $value)
    {
        if (!array_key_exists($relation, $this->getRelations())) {
            $this->setRelation($relation, new Collection([$value]));
        } else {
            $this->getRelation($relation)->add($value);
        }

        return $this;
    }
public function appendRelation($relation, $value)
    {
        if (!array_key_exists($relation, $this->getRelations())) {
            $this->setRelation($relation, new Collection([$value]));
        } else {
            $this->getRelation($relation)->add($value);
        }

        return $this;
    }
public function appendRelation ( $ relation , $ value ) { if ( ! array_key_exists ( $ relation , $ this -> getRelations ( ) ) ) { $ this -> setRelation ( $ relation , new Collection ( [ $ value ] ) ) ; } else { $ this -> getRelation ( $ relation ) -> add ( $ value ) ; } return $ this ; }
Pushes a new item to a relation.

@param $relation
@param $value
@return $this
Pushes a new item to a relation .