Nwidart\Modules\Collection::toArray PHP Method

toArray() public method

Get the collection of items as a plain array.
public toArray ( ) : array
return array
    public function toArray()
    {
        return array_map(function ($value) {
            if ($value instanceof Module) {
                return $value->json()->getAttributes();
            }
            return $value instanceof Arrayable ? $value->toArray() : $value;
        }, $this->items);
    }