Reacter
Prefer to use Reacter Facade instead of lower level Reacter model for the API simplicity and easier future migration process.
Get Reacterable
$reacterable = $reacter->getReacterable();
Returns User
, Person
, Organization
or any other model which acting as this Reacter
.
React to Reactant
$reacter->reactTo($reactant, $reactionType);
Reaction weight could be affected by $rate
value:
$reacter->reactTo($reactant, $reactionType, 4.0);
Minimum
$rate
value is0.01
.
Maximum$rate
value is99.99
.
Remove Reaction from Reactant
$reacter->unreactTo($reactant, $reactionType);
Check if Reacter Reacted to Reactant
Determine if Reacter
reacted to Reactant
with any type of reaction.
$isReacted = $reacter->hasReactedTo($reactant);
$isNotReacted = $reacter->hasNotReactedTo($reactant);
Determine if Reacter
reacted to Reactant
with exact type of reaction.
$reactionType = ReactionType::fromName('Like');
$isReacted = $reacter->hasReactedTo($reactant, $reactionType);
$isNotReacted = $reacter->hasNotReactedTo($reactant, $reactionType);
Determine if Reacter
reacted to Reactant
with exact type of reaction and exact rate
value.
$reactionType = ReactionType::fromName('Like');
$isReacted = $reacter->hasReactedTo($reactant, $reactionType, 4.0);
$isNotReacted = $reacter->hasNotReactedTo($reactant, $reactionType, 4.0);
Get Reactions Which Reacter Has Made
$reactions = $reacter->getReactions();
Updated over 4 years ago