cybercog / laravel-love

Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
https://komarev.com/sources/laravel-love
MIT License
1.17k stars 71 forks source link

Sorting by nested or hierarchial Reactable order #180

Open mbryne opened 4 years ago

mbryne commented 4 years ago

Greetings,

Thank you very much for your efforts on this package over its many iterations, it is obvious that a lot of time and thought has gone into it and it is very much appreciated.

I am in the process of implementing threaded commenting for our application, so a Comment can have a parent Comment etc. I would like to be able sort Comments within an individual conversation thread (similar to reddit's 'Best' option for comments).

How feasible would this be with the existing reaction_like_weight / reaction_like_count ordering already in place? Could this be solved with some kind of multiplication of the reaction weight by the depth of the conversation so top level conversations have a higher weight ( 10000) with lower depths ( 1000, * 100) etc?

Is there a way to define the overall scope of a Reactable model to include things like parent_id etc?

I'm happy to dig in and play around but I figured there is no harm in asking up front before I do so,

Many thanks in advance, Michael

antonkomarev commented 4 years ago

Hey, @mbryne! This is interesting case. I haven't thought about it before. Need to dive deeper in it. I have not much free time right now, but I'll try to find some.

mbryne commented 4 years ago

No worries at all @antonkomarev, any input you can offer is appreciated but no pressure at all. The work you have put in so far is already immensely useful to us.

I’ve been pouring over the existing issues and discussions and if I come across any issues that are within my skill set to assist with I will be sure to shoot through a pull request.

Thanks again.