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?
Hi @antonkomarev, this PR is to demonstrate some breaks that are happening when the joinReactionCounterOfType is called with the withCount method on morphable relations. The issue is not apparent when run in the in-memory database but when you switch to a mysql connection it shows up.
The error that shows up is
Illuminate\Database\QueryException: SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: selectarticles.*, (select count(*) frommorphable_entitieswherearticles.id=morphable_entities.morphable_idandmorphable_entities.morphable_type= 1) asmorphable_entities_count, COALESCE(reaction_like.count, 0) as reaction_like_count, COALESCE(reaction_like.weight, 0) as reaction_like_weight fromarticlesleft joinlove_reactant_reaction_countersasreaction_likeonreaction_like.reactant_id=articles.love_reactant_idandreaction_like.reaction_type_id= ? order byreaction_like_countasc)
Hi @antonkomarev, this PR is to demonstrate some breaks that are happening when the
joinReactionCounterOfType
is called with thewithCount
method on morphable relations. The issue is not apparent when run in the in-memory database but when you switch to a mysql connection it shows up.The error that shows up is
Illuminate\Database\QueryException: SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: select
articles.*, (select count(*) from
morphable_entitieswhere
articles.
id=
morphable_entities.
morphable_idand
morphable_entities.
morphable_type= 1) as
morphable_entities_count, COALESCE(reaction_like.count, 0) as reaction_like_count, COALESCE(reaction_like.weight, 0) as reaction_like_weight from
articlesleft join
love_reactant_reaction_countersas
reaction_likeon
reaction_like.
reactant_id=
articles.
love_reactant_idand
reaction_like.
reaction_type_id= ? order by
reaction_like_countasc)