Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Update read/unread notification relationships to use base relationship #17093

Merged

Conversation

patrickcarlohickman
Copy link
Contributor

The "read" and "unread" relationships for notifications use the same logic as the base relationship definition, except for the addition of the where clause. This PR updates the "read" and "unread" relationships to build off of the base notifications() relationship, instead of redefining the same logic.

The main reason for the PR is to make it easier for those that wish to use their own custom Model for the notifications table, instead of the built in DatabaseNotification model. If one wants to use their own model, one would need to override all three relationships. With this change, one only needs to override the base notifications() relationship, and the read/unread relationships can be left alone.

@taylorotwell taylorotwell merged commit 16b3725 into laravel:5.3 Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants