src/Collections/BaseCollection.php
public function toData()
    {
        $data = [];
        foreach ($this->elements as $element) {
            $data[] = $element->toData();
        }

        return $data;
    }
public function toData()
    {
        $data = [];
        foreach ($this->elements as $element) {
            $data[] = $element->toData();
        }

        return $data;
    }
public function toData ( ) { $ data = [ ] ; foreach ( $ this -> elements as $ element ) { $ data [ ] = $ element -> toData ( ) ; } return $ data ; }
Get all elements array data

@return array
Get all elements array data