src/Collection.php
public function toArray()
    {
        $urls = [];
        $actions = [];
        
        if (count($this->items) < 1) {
            return parent::toArray();
        }
        
        $entity = $this->items[0];
        
        if (is_array($entity->load)) {
            foreach ($entity->load as $k => $load) {
                $this->load($load);
            }
        }
        
        $data = parent::toArray();
        $actions = $entity->getActions();
        
        if (count($actions) > 0) {
            foreach ($data as $k => $resource) {
                
                if (count($resource) < 2) {
                    continue;
                }
                
                $data[$k] += [
                    'actions' => $actions
                ];
            }
        }
        
        $data = $this->normalizeArray($data);
        
        return $data;
    }
public function toArray()
    {
        $urls = [];
        $actions = [];
        
        if (count($this->items) < 1) {
            return parent::toArray();
        }
        
        $entity = $this->items[0];
        
        if (is_array($entity->load)) {
            foreach ($entity->load as $k => $load) {
                $this->load($load);
            }
        }
        
        $data = parent::toArray();
        $actions = $entity->getActions();
        
        if (count($actions) > 0) {
            foreach ($data as $k => $resource) {
                
                if (count($resource) < 2) {
                    continue;
                }
                
                $data[$k] += [
                    'actions' => $actions
                ];
            }
        }
        
        $data = $this->normalizeArray($data);
        
        return $data;
    }
Get the collection of items as a plain array.

@return array