$params['id'], 'status' => $params['status'], ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } public static function delete(array $params) { $comment = CommunityComment::findOrEmpty($params['id']); if (!$comment->isEmpty()) { CommunityPost::where('id', $comment->post_id)->dec('comment_count')->update(); $comment->delete(); } } }