src/Collection/Collection.php
public function toArray()
    {
        return array_map(function ($value) {
            return ($value instanceof Arrayable || instance_of_laravel_arrayable($value)) ? $value->toArray() : $value;

        }, $this->items);
    }
public function toArray()
    {
        return array_map(function ($value) {
            return ($value instanceof Arrayable || instance_of_laravel_arrayable($value)) ? $value->toArray() : $value;

        }, $this->items);
    }
Get the collection of items as a plain array.

@return array