Solvedlaravel geoip When CACHE_DRIVER=file => "This cache store does not support tagging"

Hi,

When "CACHE_DRIVER=file" is receive this error:
BadMethodCallException in Repository.php line 391: This cache store does not support tagging. in Repository.php line 391 at Repository->tags(array('torann-geoip-location')) in CacheManager.php line 301 at CacheManager->__call('tags', array(array('torann-geoip-location'))) in Cache.php line 32 at Cache->__construct(object(CacheManager), array('torann-geoip-location'), '30') in GeoIP.php line 91

Unfortunatly, I must configure my cache this way to make it work:
CACHE_DRIVER=array

FYI, I'm upgrading from 0.2 to 1.0. Was working with "CACHE_DRIVER=file"

Any ideas?

20 Answers

✔️Accepted Answer

@omer414 You can set the cache_tags to null or remove it completely from the config file. This will prevent using cache tags, but still cache. By doing this you lose the ability to clear the geoip only cache via the artisan command.

'cache_tags' => null,

Other Answers:

Go to .env and write CACHE_DRIVER=array

Is it possible to do this without changing the cache driver to array? In the previous version this worked fine with the file driver, is there a way we can still do this with the file driver? I am a bit concerned about how it might effect the rest of the system.

To remove the cache tags you can set the option to null in the config file.

'cache_tags' => null,

Solved with this

'cache_tags' => env('CACHE_DRIVER', 'array') === "file" ? null : ['torann-geoip-location'],