src/Collection.php
public function add(string $key, $value): self
    {
        if (! array_key_exists($key, $this->props)) {
            return $this->addNew($key, $value);
        }

        if (is_array($this->props[$key])) {
            return $this->addArray($key, $value);
        }

        return $this->appendToArray($key, $value);
    }
public function add(string $key, $value): self
    {
        if (! array_key_exists($key, $this->props)) {
            return $this->addNew($key, $value);
        }

        if (is_array($this->props[$key])) {
            return $this->addArray($key, $value);
        }

        return $this->appendToArray($key, $value);
    }
public function add ( string $ key , $ value ) : self { if ( ! array_key_exists ( $ key , $ this -> props ) ) { return $ this -> addNew ( $ key , $ value ) ; } if ( is_array ( $ this -> props [ $ key ] ) ) { return $ this -> addArray ( $ key , $ value ) ; } return $ this -> appendToArray ( $ key , $ value ) ; }
add new item to props

@param mixed $value
add new item to props