-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bugSomething isn't workingSomething isn't working
Description
PHP & Platform
8.2
Database
No response
Laravel version
11.51
Have you done this?
- I have checked my logs and I'm sure is a bug in this package.
- I can reproduce this bug in isolation (vanilla Laravel install)
- I can suggest a workaround as a Pull Request
Expectation
Without using the "as" method, it still requests the key property of the Cache class, leading to an empty cache key being requested.
Thank you.
Description
I believe this function is the culprit. Sometimes $this->cache->key is empty.
protected function retrieveResultsFromCache(string $key): array
{
// If the cache should be regenerated, just return empty results.
if ($this->cache->regenFactor === (bool) value($this->cache->regenerate)) {
return [$key => null, $this->cache->key => null];
}
return $this->repository->getMultiple([$key, $this->cache->key]);
}
Reproduction
\Event::listen(\Illuminate\Cache\Events\CacheMissed::class, function ($e) {
dump($e->key);
});
\App\Models\Platform::cache(now()->addMinutes(10))->get();
Two keys are dumped:
"cache-query|**************"
""Stack trace & logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working