fix: 🐛 call the cache reset method on every model event for the claim subject and template

This commit is contained in:
Alexis Gousseau 2025-08-25 14:22:50 +02:00
parent 2f8a53c653
commit b9f43428d8
No known key found for this signature in database
GPG key ID: 4A614CB3DBBA2406
2 changed files with 36 additions and 0 deletions

View file

@ -29,6 +29,24 @@ class ClaimMailTemplate extends Model
'brand_id',
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted(): void
{
static::created(function () {
self::resetCache();
});
static::updated(function () {
self::resetCache();
});
static::deleted(function () {
self::resetCache();
});
}
// * METHODS
/**

View file

@ -27,6 +27,24 @@ class ClaimSubject extends Model
'brand_id',
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted(): void
{
static::created(function () {
self::resetCache();
});
static::updated(function () {
self::resetCache();
});
static::deleted(function () {
self::resetCache();
});
}
// * METHODS
/**