upgrade of __t function, add save default_language to cache

This commit is contained in:
Milos Holba
2021-03-22 20:27:47 +01:00
parent 5910bb1206
commit df5d5cb75f
17 changed files with 351 additions and 122 deletions
+12
View File
@@ -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');
}
});
}
}