public function random($number = null)
    {
        if (is_null($number)) {
            return Arr::random($this->items);
        }

        return new static(Arr::random($this->items, $number));
    }
public function random($number = null)
    {
        if (is_null($number)) {
            return Arr::random($this->items);
        }

        return new static(Arr::random($this->items, $number));
    }
public function random ( $ number = null ) { if ( is_null ( $ number ) ) { return Arr :: random ( $ this -> items ) ; } return new static ( Arr :: random ( $ this -> items , $ number ) ) ; }
Get one or a specified number of items randomly from the collection.

@param  int|null  $number
@return static|mixed

@throws \InvalidArgumentException
Get one or a specified number of items randomly from the collection .