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');
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');
Get Reactions Which Reacterable Has Made
$reactions = $reacterFacade->getReactions();
Updated almost 6 years ago