diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 1f3c119a..136c3ba5 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -234,7 +234,8 @@ class StatusController extends Controller 'item' => 'required|integer|min:1', ]); - $profile = Auth::user()->profile; + $user = Auth::user(); + $profile = $user->profile; $status = Status::withCount('shares')->findOrFail($request->input('item')); $count = $status->shares_count; @@ -265,6 +266,8 @@ class StatusController extends Controller $status->save(); } + Cache::forget('status:'.$status->id.':sharedby:userid:'.$user->id); + if ($request->ajax()) { $response = ['code' => 200, 'msg' => 'Share saved', 'count' => $count]; } else {