diff --git a/resources/views/components/frameworks/tailwind/header/export.blade.php b/resources/views/components/frameworks/tailwind/header/export.blade.php
index c8325493..439343b1 100644
--- a/resources/views/components/frameworks/tailwind/header/export.blade.php
+++ b/resources/views/components/frameworks/tailwind/header/export.blade.php
@@ -13,6 +13,7 @@ class="pg-btn-white dark:ring-pg-primary-600 dark:border-pg-primary-600 dark:hov
visibleColumns as &$column) {
- if (data_get($column, 'field') === $field) {
- data_set($column, 'hidden', !data_get($column, 'hidden'));
+ $this->visibleColumns = $this->visibleColumns->map(function (\stdClass | array $column) use ($field) {
+ if (is_object($column) && $column->field === $field) {
+ $column->hidden = !$column->hidden;
+ }
- break;
+ if (is_array($column) && $column['field'] === $field) {
+ $column['hidden'] = !$column['hidden'];
}
- }
+
+ return $column;
+ });
$this->persistState('columns');
}
diff --git a/src/PowerGridComponent.php b/src/PowerGridComponent.php
index 1c857720..381beb73 100644
--- a/src/PowerGridComponent.php
+++ b/src/PowerGridComponent.php
@@ -20,7 +20,7 @@
/**
* @property-read mixed $getCachedData
* @property-read bool $hasColumnFilters
- * @property-read array|BaseCollection $visibleColumns
+ * @property array|BaseCollection $visibleColumns
*/
class PowerGridComponent extends Component
{