public static function sort($array, $key, $order = 'asc', $sort_flags = SORT_REGULAR)
    {
        if (!is_array($array)) {
            throw new \InvalidArgumentException('Arr::sort() - $array must be an array.');
        }

        if (empty($array)) {
            return $array;
        }

        foreach ($array as $k => $v) {
            $b[$k] = static::get($v, $key);
        }

        switch ($order) {
            case 'asc':
                asort($b, $sort_flags);
                break;

            case 'desc':
                arsort($b, $sort_flags);
                break;

            default:
                throw new \InvalidArgumentException('Arr::sort() - $order must be asc or desc.');
                break;
        }

        foreach ($b as $key => $val) {
            $c[] = $array[$key];
        }

        return $c;
    }