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 then Cog\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 returns NullReactant if Reactable model is not registered as Reactant.

Verify Reacterable Registration

Use boolean methods to verify if Reactable is registered as Reactant or not.

$isRegistered = $comment->isRegisteredAsLoveReactant(); // true

$isNotRegistered = $comment->isNotRegisteredAsLoveReactant(); // false