|
|
@ -29,8 +29,7 @@ class LikeController extends Controller
|
|
|
|
$profile = $user->profile;
|
|
|
|
$profile = $user->profile;
|
|
|
|
$status = Status::findOrFail($request->input('item'));
|
|
|
|
$status = Status::findOrFail($request->input('item'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Like::whereStatusId($status->id)->whereProfileId($profile->id)->exists()) {
|
|
|
|
if ($status->likes()->whereProfileId($profile->id)->count() !== 0) {
|
|
|
|
|
|
|
|
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();
|
|
|
|
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();
|
|
|
|
UnlikePipeline::dispatch($like);
|
|
|
|
UnlikePipeline::dispatch($like);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|