laravel-love
laravel-love copied to clipboard
Add query scopes to Reacterable trait
This MR adds whereReactedTo
& whereNotReactedTo
query scopes to Reacterable trait to find all Reacterable models who reacted to the Reactable model. This concept was born after discussion with @vesper8 in #181
Find users who reacted with any type of reaction to the article
$article = Article::whereKey(1)->firstOrFail();
$usersReactedToArticle = User::whereReactedTo($article);
Find users who reacted with one concerete type of reaction to the article
$article = Article::whereKey(1)->firstOrFail();
$likeReactionType = ReactionType::fromName('Like');
$usersLikedTheArticle = User::whereReactedTo($article, $likeReactionType);
This MR doesn't have tests yet and I'm not sure if we should add it to the minor release.
Can this be merged please..
@muarachmann I will try to continue work soon and try to release it in v9
@vesper8 @muarachmann sorry for the long wait. Finally, I gave some Love to this package :)
@antonkomarev Very nice to see you still caring about this awesome package that I'm still using in production on several projects : )
It would be awesome if you could think of a way to address https://github.com/cybercog/laravel-love/issues/192 next : )
Many thanks!! Glad to have you back! And happy new year to you!
Thanks @antonkomarev for this. Was much needed.