Reactable
Reactable Registration
Reactable
registers as Reactant
only once. It will be done automatically on each successful create of theReactable
.
Register Reacterable
manually:
$user->registerAsLoveReactant();
If model already registered as
Reactant
thenCog\Contracts\Love\Reactable\Exceptions\AlreadyRegisteredAsLoveReactant
exception will be thrown.
Get Reactant Facade
Get Reactant
facade from Reactable
model. Read about Reactant Facade API.
$reactantFacade = $user->viaLoveReactant();
Get Reactant Model
Get Reactant
model from Reactable
model. Read about Reactant Model API.
$reactant = $user->getLoveReactant();
Reactant Null Object
Method
getLoveReactant
returnsNullReactant
ifReactable
model is not registered asReactant
.
Verify Reacterable Registration
Use boolean methods to verify if Reactable
is registered as Reactant
or not.
$isRegistered = $comment->isRegisteredAsLoveReactant(); // true
$isNotRegistered = $comment->isNotRegisteredAsLoveReactant(); // false
Updated almost 2 years ago