public function unique($key = null, $strict = false)
    {
        if (! is_null($key)) {
            return parent::unique($key, $strict);
        }

        return new static(array_values($this->getDictionary()));
    }
public function unique($key = null, $strict = false)
    {
        if (! is_null($key)) {
            return parent::unique($key, $strict);
        }

        return new static(array_values($this->getDictionary()));
    }
public function unique ( $ key = null , $ strict = false ) { if ( ! is_null ( $ key ) ) { return parent :: unique ( $ key , $ strict ) ; } return new static ( array_values ( $ this -> getDictionary ( ) ) ) ; }
Return only unique items from the collection.

@param  string|callable|null  $key
@param  bool  $strict
@return static|\Illuminate\Support\Collection
Return only unique items from the collection .