Clear prize cache when updating instant win

This commit is contained in:
Jérémy Munsch 2024-01-23 10:10:21 +00:00 • committed by Vincent BRIDIER
parent 816bab3cb3
commit ec8b4ffba5
2 changed files with 14 additions and 5 deletions

View file

@ -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

View file

@ -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
}
}