Get all unread notifications#272
Merged
Gummibeer merged 3 commits intofenos:masterfrom Mar 31, 2017
ziishaned:master
Merged
Conversation
Gummibeer
requested changes
Mar 30, 2017
Collaborator
Gummibeer
left a comment
There was a problem hiding this comment.
Pls change the marked things. After this we can merge it.
| public function getNotificationsNotRead($limit = null, $order = 'desc') | ||
| { | ||
| $query = $this->getNotificationRelation()->orderBy('created_at', $order); | ||
| $query = $query->where('notifications.read', 0); |
Collaborator
There was a problem hiding this comment.
We don't use the table name in queries cause this can be changed - so pls just where('read', 0)
Collaborator
There was a problem hiding this comment.
And in addition, there is a scope for this https://github.com/fenos/Notifynder/blob/master/src/Notifynder/Models/Notification.php#L193-L196 .
| * @param string $order | ||
| * @return \Illuminate\Database\Eloquent\Collection | ||
| */ | ||
| public function getNotificationsNotRead($limit = null, $order = 'desc') |
Collaborator
There was a problem hiding this comment.
Pls add an unittest for this new method, like: https://github.com/fenos/Notifynder/blob/master/tests/integration/Traits/NotifableTest.php#L77-L89
1 similar comment
Gummibeer
approved these changes
Mar 31, 2017
Collaborator
|
Thanks for this PR - it's merged and tagged as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.