One possible solution is to check if the cache driver being used is compatible with the TTL feature. For example, if the file driver is used, it may not support TTL. Another solution is to try using the Cache::remember method with a closure that returns the value to be cached. This way, the cache will be refreshed after the TTL expires. Here's an example:
$value = Cache::remember('name', 30, function () {
return 'value';
});
# wait 10-15 seconds
$value = Cache::get('name'); # should return null or false
# wait another 10-15 seconds
$value = Cache::get('name'); # should return 'value' again
If the issue persists, it may be worth checking the cache configuration and the cache driver implementation.