public function max($key = null)
    {
        return $this->reduce(function ($result, $item) use ($key) {
            $value = data_get($item, $key);

            return is_null($result) || $value > $result ? $value : $result;
        });
    }
public function max($key = null)
    {
        return $this->reduce(function ($result, $item) use ($key) {
            $value = data_get($item, $key);

            return is_null($result) || $value > $result ? $value : $result;
        });
    }
public function max ( $ key = null ) { return $ this -> reduce ( function ( $ result , $ item ) use ( $ key ) { $ value = data_get ( $ item , $ key ) ; return is_null ( $ result ) || $ value > $ result ? $ value : $ result ; } ) ; }
Get the max value of a given key.

@param  string|null $key

@return mixed
Get the max value of a given key .