public static function collate($array, $key, $wildcard = null)
    {
        // If no wildcard set or the wildcard is not in the key
        if (null === $wildcard || strpos($key, $wildcard) === false) {
            return static::has($array, $key) ? [$key => static::get($array, $key)] : [];
        }

        $pattern  = '';
        $segments = explode('.', $key);
        while (($segment = array_shift($segments)) !== null) {
            // If we have run out of arrays to look into, stop looking
            if (!Arr::accessible($array)) {
                return [];
            }

            // If this segment is a wildcard
            if ($segment === $wildcard) {
                $values = [];
                foreach (array_keys($array) as $attr) {
                    $subKey = implode('.', array_merge([$attr], $segments));
                    foreach (static::collate($array, $subKey, $wildcard) as $attrKey => $value) {
                        $values[$pattern . $attrKey] = $value;
                    }
                }

                return $values;
            }
            if (Arr::exists($array, $segment)) {
                $array = $array[$segment];
            } else {
                return [];
            }

            $pattern .= $segment . '.';
        }

        return [$key => $array];
    }