1
0
Fork 0

Update StatusController

This commit is contained in:
Daniel Supernault 2019-06-18 01:16:10 -06:00
parent 7d7a64382b
commit 6095f4c9c7
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 4 additions and 1 deletions

View File

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