diff --git a/app/Models/Host.php b/app/Models/Host.php index 6ec7f0f..ca78c38 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -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); + }); } }