mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-14 01:05:02 +00:00
upgrade of __t function, add save default_language to cache
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
@@ -23,4 +24,15 @@ class Setting extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::updated(function($setting) {
|
||||
if($setting->name === 'language') {
|
||||
Cache::forget('default_language');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user