From ec8b4ffba5663ea17639945dd6bf7422bb90be08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 23 Jan 2024 10:10:21 +0000 Subject: [PATCH] Clear prize cache when updating instant win --- app/Models/InstantWin.php | 15 ++++++++++++--- composer.json | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Models/InstantWin.php b/app/Models/InstantWin.php index f3a05e8..35e9052 100644 --- a/app/Models/InstantWin.php +++ b/app/Models/InstantWin.php @@ -41,9 +41,18 @@ class InstantWin extends Model */ protected static function booted() { - static::creating(fn () => self::removeCached()); - static::updating(fn () => self::removeCached()); - static::deleting(fn () => self::removeCached()); + static::creating(function () { + InstantWin::removeCached(); + Prize::removeCached(); + }); + static::updating(function () { + InstantWin::removeCached(); + Prize::removeCached(); + }); + static::deleting(function () { + InstantWin::removeCached(); + Prize::removeCached(); + }); } // * RELATIONSHIPS diff --git a/composer.json b/composer.json index 7da2b39..430c63f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "uwil/gen-game-web", - "version": "2.2.5", + "version": "2.2.6", "type": "project", "description": "Game generator", "support": { @@ -103,4 +103,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} +} \ No newline at end of file