laravel/framework · error · BadMethodCallException
This cache store does not support tagging.
Error message
This cache store does not support tagging.
What it means
Thrown by Cache\Repository::tags() when supportsTags() is false, i.e. the store has no tags() method (method_exists check). Tagged caching is only available on stores that implement tag sets, such as redis, memcached, array, and database (with the tag table). File and DynamoDB stores do not.
Source
Thrown at src/Illuminate/Cache/Repository.php:850
} else {
$this->event(new CacheLocksFlushFailed($this->getName()));
}
return $result;
}
/**
* Begin executing a new tags operation if the store supports it.
*
* @param mixed $names
* @return \Illuminate\Cache\TaggedCache
*
* @throws \BadMethodCallException
*/
public function tags($names)
{
if (! $this->supportsTags()) {
throw new BadMethodCallException('This cache store does not support tagging.');
}
$cache = $this->store->tags(is_array($names) ? $names : func_get_args());
$cache->config = $this->config;
if (! is_null($this->events)) {
$cache->setEventDispatcher($this->events);
}
return $cache->setDefaultCacheTime($this->default);
}
/**
* Format the key for a cache item.
*
* @param string $key
* @return stringView on GitHub (pinned to bd6b5437e6)
Solutions
- Switch CACHE_STORE to redis, memcached, database, or array (array supports tags).
- Guard the call: if (Cache::supportsTags()) { Cache::tags(['users'])->flush(); }.
- Refactor to manual key-prefix invalidation if you must keep a non-tagging store.
- If using the database store, ensure migrations for the cache and cache_tags tables are present.
Example fix
// before
Cache::tags(['posts'])->flush();
// after
if (Cache::supportsTags()) {
Cache::tags(['posts'])->flush();
}
// or .env: CACHE_STORE=redis Defensive patterns
Strategy: validation
Validate before calling
if (! Cache::supportsTags()) {
// use a non-tagged key scheme or switch store
} Type guard
function cacheSupportsTags(): bool {
return Cache::supportsTags();
} Try / catch
try {
Cache::tags(['users'])->flush();
} catch (\BadMethodCallException $e) {
// store can't tag; flush by key prefix instead
} Prevention
- Gate Cache::tags() with Cache::supportsTags().
- Align CACHE_STORE across envs (use redis/database/array where tags are needed).
- For the database store, ensure the cache_tags migration has run.
When it happens
Trigger: Calling Cache::tags(['users'])->put(...) or Cache::tags(['users'])->flush() while CACHE_STORE is file, dynamodb, or another store without a tags() method.
Common situations: Local dev using CACHE_STORE=file hitting code that tags cached query results; running the app with a custom Store that did not implement tags(); CI using array driver but the test calls tags() on a cache facade backed by something else.
Related errors
- This cache store does not support locks.
- This cache store does not support flushing locks.
- Cache value for key [%s] must be a string, %s given.
- Cache value for key [%s] must be an integer, %s given.
- Cache value for key [%s] must be a float, %s given.
AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06).
Data as JSON: /data/errors/34a3d607175be015.json.
Report an issue: GitHub.