private function commentNeedsNotification($comment, $user) { if ($comment['updated_at'] < $user['created_at']) { return false; } return NotifiedComment::where('github_id', $comment['id'])->where('github_updated_at', $comment['updated_at'])->count() == 0; }
private function commentNoLongerNeedsNotification() { return NotifiedComment::where('github_id', $this->comment['id'])->where('github_updated_at', $this->comment['updated_at'])->count() > 0; }
private function markCommentAsNotified($comment) { $eloquentComment = NotifiedComment::firstOrNew(['github_id' => $comment['id']]); $eloquentComment->github_updated_at = Carbon::createFromFormat('Y-m-d\\TH:i:s\\Z', $comment['updated_at']); $eloquentComment->save(); }