protected function cleanArray($array, $keys = null)
    {
        $keys = $keys ?: array_keys($array);

        foreach ($keys as $key) {
            if (is_array($value = Arr::get($array, $key))) {
                Arr::set($array, $key, array_filter($value));
            }
        }

        return $array;
    }