<?php

namespace Propaganistas\LaravelHelperMacros\Macros;

use Illuminate\Support\Arr;
if (!Arr::hasMacro('expand')) {
    /**
     * Expands a dotted associative array. The inverse of Arr::dot().
     *
     * @param  array $array
     * @return array
     */
    Arr::macro('expand', function (array $array) {
        $return = [];
        foreach ($array as $key => $value) {
            array_set($return, $key, $value);
        }
        return $return;
    });
}