Guard HandleStripeWebhook plan-cache bust against non-taggable cache stores
bustPlanCache() called Cache::tags() unconditionally, which throws on the `database`/`file` cache drivers. Mirror the Cache::supportsTags() idiom used in Plan.php so Stripe webhooks work regardless of the configured cache store. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -129,8 +129,9 @@ final class HandleStripeWebhook
|
||||
|
||||
private function bustPlanCache(User $user): void
|
||||
{
|
||||
$tag = Cache::tags(['plans']);
|
||||
$tag->forget("plan_for_user_{$user->id}");
|
||||
$tag->forget("plan_cadence_for_user_{$user->id}");
|
||||
$cache = Cache::supportsTags() ? Cache::tags(['plans']) : Cache::store();
|
||||
|
||||
$cache->forget("plan_for_user_{$user->id}");
|
||||
$cache->forget("plan_cadence_for_user_{$user->id}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user