Update StatusHashtagObserver

This commit is contained in:
Daniel Supernault 2022-12-27 04:16:34 -07:00
parent 4fd12b063b
commit 29f2c50e2e
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@
namespace App\Observers;
use DB;
use App\StatusHashtag;
use App\Services\StatusHashtagService;
@ -23,6 +24,7 @@ class StatusHashtagObserver
public function created(StatusHashtag $hashtag)
{
StatusHashtagService::set($hashtag->hashtag_id, $hashtag->status_id);
DB::table('hashtags')->where('id', $hashtag->hashtag_id)->increment('cached_count');
}
/**
@ -45,6 +47,7 @@ class StatusHashtagObserver
public function deleted(StatusHashtag $hashtag)
{
StatusHashtagService::del($hashtag->hashtag_id, $hashtag->status_id);
DB::table('hashtags')->where('id', $hashtag->hashtag_id)->decrement('cached_count');
}
/**