public function attribute(string $key)
    {
        if ($key !== 'value') {
            return parent::attribute($key);
        }

        return array_map(
            function (ElementInterface $element) {
                return $element->value();
            },
            $this->elements()
        );
    }
public function attribute(string $key)
    {
        if ($key !== 'value') {
            return parent::attribute($key);
        }

        return array_map(
            function (ElementInterface $element) {
                return $element->value();
            },
            $this->elements()
        );
    }
public function attribute ( string $ key ) { if ( $ key !== 'value' ) { return parent :: attribute ( $ key ) ; } return array_map ( function ( ElementInterface $ element ) { return $ element -> value ( ) ; } , $ this -> elements ( ) ) ; }
Returns a list of values for each element inside the collection.

@param string $key

@return array
Returns a list of values for each element inside the collection .