src/Arrays.php
public function pluck($array, $property, &$return = false)
    {
        $return = [];

        if (count($array) > 0) {
            foreach ($array as $item) {
                if (is_array($item)) {
                    $this->pluck($array, $property, $return);
                }

                $return[] = $item->$property;
            }
        }

        return $return;
    }
public function pluck($array, $property, &$return = false)
    {
        $return = [];

        if (count($array) > 0) {
            foreach ($array as $item) {
                if (is_array($item)) {
                    $this->pluck($array, $property, $return);
                }

                $return[] = $item->$property;
            }
        }

        return $return;
    }
public function pluck ( $ array , $ property , & $ return = false ) { $ return = [ ] ; if ( count ( $ array ) > 0 ) { foreach ( $ array as $ item ) { if ( is_array ( $ item ) ) { $ this -> pluck ( $ array , $ property , $ return ) ; } $ return [ ] = $ item -> $ property ; } } return $ return ; }
Fetch the same property for all the elements.

@param Nip\Records\Collections\Collection $array
@param string $property
@param bool|string $return
@return array The property values
Fetch the same property for all the elements .