src/Primitive/Support/Traits/RetrievableTrait.php
public function getArrayable($value, $default = null)
    {
        switch (true)
        {
            case is_array($value);
                return $value;
            case $value instanceof ContainerContract:
                return $value->value();
            case $value instanceof ArrayableContract:
                return $value->toArray();
            case is_object($value):
                return get_object_vars($value);
            default:
                return value($default);
        }
    }
public function getArrayable($value, $default = null)
    {
        switch (true)
        {
            case is_array($value);
                return $value;
            case $value instanceof ContainerContract:
                return $value->value();
            case $value instanceof ArrayableContract:
                return $value->toArray();
            case is_object($value):
                return get_object_vars($value);
            default:
                return value($default);
        }
    }
Retrieve array from array, ContainerContract, ArrayableContract or
object, otherwise return $default.

@param mixed $value
@param mixed $default
@return mixed