protected function filterAttributeValues(array $attributes) { return array_filter($attributes, function ($value) { if (is_array($value) && empty($value)) { return false; } return !($value === '' || $value === null); }); }