Reacter Facade

In examples below User model is a Reacterable and Comment model is a Reactable.

$reacterFacade = $user->viaLoveReacter();

React to Reactable

$reacterFacade->reactTo($comment, 'Like');

Reaction weight could be affected by $rate value:

$reacterFacade->reactTo($comment, 'Like', 4.0);

📘

Minimum $rate value is 0.01.
Maximum $rate value is 99.99.

Remove Reaction from Reactable

$reacterFacade->unreactTo($comment, 'Like');

Check if Reacterable Reacted to Reactable

Determine if User reacted to Comment with any type of reaction.

$isReacted = $reacterFacade->hasReactedTo($comment);

$isNotReacted = $reacterFacade->hasNotReactedTo($comment);

Determine if User reacted to Comment with exact type of reaction.

$isReacted = $reacterFacade->hasReactedTo($comment, 'Like');

$isNotReacted = $reacterFacade->hasNotReactedTo($comment, 'Like');

Determine if User reacted to Comment with exact type of reaction and exact rate value.

$isReacted = $reacterFacade->hasReactedTo($comment, 'Like', 4.0);

$isNotReacted = $reacterFacade->hasNotReactedTo($comment, 'Like', 4.0);

Get Reactions Which Reacterable Has Made

$reactions = $reacterFacade->getReactions();