Skip to content

Instantly share code, notes, and snippets.

@fhuitelec
Last active October 2, 2017 16:37
Show Gist options
  • Save fhuitelec/1157b63cd1d2c2a9633b05f727946d00 to your computer and use it in GitHub Desktop.
Save fhuitelec/1157b63cd1d2c2a9633b05f727946d00 to your computer and use it in GitHub Desktop.
madewithlove - Avoiding conditional blog post - Comment #comment
<?php
/*
* Comment available here: http://disq.us/p/1lek1yc
*
* Notification collection consumer point of view.
*/
$notifications = Notifications::make()
->add($this->buildParentCreatorNotification($comment))
->add($this->buildNotificationsForAssignedUsers($comment))
->add($this->buildNotificationsForCommenters($comment));
return $notifications
->mergeDuplicates()
->filterOutCommentAuthor($comment);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment