Update FollowerController

This commit is contained in:
Daniel Supernault 2019-02-24 22:57:22 -07:00
parent c3aa407b9a
commit d1d8fa4acd
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 4 additions and 1 deletions

View File

@ -8,7 +8,7 @@ use App\{
Profile, Profile,
UserFilter UserFilter
}; };
use Auth; use Auth, Cache;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Jobs\FollowPipeline\FollowPipeline; use App\Jobs\FollowPipeline\FollowPipeline;
@ -67,5 +67,8 @@ class FollowerController extends Controller
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail(); $follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
$follower->delete(); $follower->delete();
} }
Cache::forget('profile:followers:'.$target->id);
Cache::forget('profile:following:'.$user->id);
} }
} }