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
ReactantthenCog\Contracts\Love\Reactable\Exceptions\AlreadyRegisteredAsLoveReactantexception 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
getLoveReactantreturnsNullReactantifReactablemodel 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 over 2 years ago
