清理缓存

This commit is contained in:
iVampireSP.com 2022-09-10 12:05:28 +08:00
parent 26eb9050b8
commit b2e7e29889
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -183,6 +183,8 @@ protected static function boot()
// when Updated
static::updated(function ($model) {
dispatch(new \App\Jobs\Remote\Host($model, 'patch'));
Cache::forget('user_hosts_' . $model->user_id);
});
// // when delete
@ -191,5 +193,9 @@ protected static function boot()
// // dispatch(new \App\Jobs\Remote\Host($model, 'delete'));
// });
static::deleted(function ($model) {
Cache::forget('user_hosts_' . $model->user_id);
});
}
}