refactor: remove diagnostic and translation scripts and implement automatic cache clearing for settings in the model.
This commit is contained in:
@@ -10,6 +10,17 @@ class Setting extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::saved(function ($setting) {
|
||||
\Illuminate\Support\Facades\Cache::forget("app_setting_{$setting->key}");
|
||||
});
|
||||
|
||||
static::deleted(function ($setting) {
|
||||
\Illuminate\Support\Facades\Cache::forget("app_setting_{$setting->key}");
|
||||
});
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'key',
|
||||
'value',
|
||||
|
||||
Reference in New Issue
Block a user