From cce815002741d2f4fbc1c124dbb6621e4411b9d3 Mon Sep 17 00:00:00 2001 From: luanfreitasdev Date: Thu, 28 Sep 2023 19:03:41 -0300 Subject: [PATCH 1/2] fx cache ttl --- src/PowerGridComponent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerGridComponent.php b/src/PowerGridComponent.php index 54248ec2..9451c545 100644 --- a/src/PowerGridComponent.php +++ b/src/PowerGridComponent.php @@ -155,7 +155,7 @@ private function getCachedData(): mixed $prefix = strval(data_get($this->setUp, 'cache.prefix')); $customTag = strval(data_get($this->setUp, 'cache.tag')); $forever = boolval(data_get($this->setUp, 'cache.forever', false)); - $ttl = boolval(data_get($this->setUp, 'cache.ttl', false)); + $ttl = intval(data_get($this->setUp, 'cache.ttl')); $tag = $prefix . ($customTag ?: 'powergrid-' . $this->datasource()->getModel()->getTable() . '-' . $this->tableName); $cacheKey = join('-', $this->getCacheKeys()); From b3eb6959669934b5222ab2db2d0a30f0c6b95ad7 Mon Sep 17 00:00:00 2001 From: luanfreitasdev Date: Thu, 28 Sep 2023 19:04:10 -0300 Subject: [PATCH 2/2] fx cache ttl --- src/PowerGridComponent.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PowerGridComponent.php b/src/PowerGridComponent.php index 9451c545..97b531d8 100644 --- a/src/PowerGridComponent.php +++ b/src/PowerGridComponent.php @@ -164,7 +164,6 @@ private function getCachedData(): mixed return $this->readyToLoad ? Cache::tags($tag)->rememberForever($cacheKey, fn () => $this->fillData()) : collect([]); } - /** @phpstan-ignore-next-line */ return $this->readyToLoad ? Cache::tags($tag)->remember($cacheKey, $ttl, fn () => $this->fillData()) : collect([]); }