public function remove(string $key): self
    {
        if (! $this->has($key)) {
            return $this;
        }

        unset($this->collection[$key]);

        return $this;
    }
public function remove(string $key): self
    {
        if (! $this->has($key)) {
            return $this;
        }

        unset($this->collection[$key]);

        return $this;
    }
public function remove ( string $ key ) : self { if ( ! $ this -> has ( $ key ) ) { return $ this ; } unset ( $ this -> collection [ $ key ] ) ; return $ this ; }
Remove an item from the collection.

@param string $key The key

@return self
Remove an item from the collection .