cache StatusTransform and invalidate on like, comment and share
This commit is contained in:
parent
1fda4c8386
commit
a891bbcc9a
4 changed files with 36 additions and 26 deletions
|
@ -26,6 +26,8 @@ class LikeController extends Controller
|
|||
$profile = Auth::user()->profile;
|
||||
$status = Status::withCount('likes')->findOrFail($request->input('item'));
|
||||
|
||||
Cache::forget('transform:status:'.$status->url());
|
||||
|
||||
$count = $status->likes_count;
|
||||
|
||||
if ($status->likes()->whereProfileId($profile->id)->count() !== 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue