Don't show deleted posts in the activity feed

This commit is contained in:
Toby Zerner 2015-03-24 19:41:30 +10:30
parent 43842623aa
commit 8be486a31d

View File

@ -17,7 +17,7 @@ class EloquentActivityRepository implements ActivityRepositoryInterface
$query->where('type', $type);
}
$posts = Post::whereCan($viewer, 'view')->with('post', 'post.discussion', 'post.user', 'post.discussion.startUser', 'post.discussion.lastUser')->select(\DB::raw("CONCAT('post', id)"), 'user_id', $null, \DB::raw("'post'"), $null, 'time', 'id')->where('user_id', $userId)->where('type', 'comment');
$posts = Post::whereCan($viewer, 'view')->with('post', 'post.discussion', 'post.user', 'post.discussion.startUser', 'post.discussion.lastUser')->select(\DB::raw("CONCAT('post', id)"), 'user_id', $null, \DB::raw("'post'"), $null, 'time', 'id')->where('user_id', $userId)->where('type', 'comment')->whereNull('hide_time');
if ($type === 'post') {
$posts->where('number', '>', 1);