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?
public function getReactionsBy(
Reacterable $reacterable,
): iterable;
Usage:
// Get all reactions the post received (API not changed)
$allReactionsOnPost = $post->viaLoveReactant()->getReactions();
// Get reactions the post received from the user
$userReactionsOnPost = $post->viaLoveReactant()->getReactionsBy($user);
Feature request appeared in issue:
237
This is implementation of the Solution №1 from the discussion:
High-level API (preferred)
Method
\Cog\Contracts\Love\Reactant\Facades\Reactant::getReactionsBy
method introduced:Usage:
Low-level API
Method
\Cog\Contracts\Love\Reactant\Models\Reactant::getReactionsBy
method introduced:Usage: