Reacterable
Reacterable Registration
Reacterable
registers as Reacter
only once. It will be done automatically on each successful create of theReacterable
.
Register Reacterable
manually:
$user->registerAsLoveReacter();
If model already registered as
Reacter
thenCog\Contracts\Love\Reacterable\Exceptions\AlreadyRegisteredAsLoveReacter
exception will be thrown.
Get Reacter Facade
Get Reacter
facade from Reacterable
model. Read about Reacter Facade API.
$reacterFacade = $user->viaLoveReacter();
Get Reacter Model
Get Reacter
model from Reacterable
model. Read about Reacter Model API.
$reacter = $user->getLoveReacter();
Reacter Null Object
Method
getLoveReacter
returnsNullReacter
ifReacterable
model is not registered asReacter
.
Verify Reacterable Registration
Use boolean methods to verify if Reacterable
is registered as Reacter
or not.
$isRegistered = $user->isRegisteredAsLoveReacter(); // true
$isNotRegistered = $user->isNotRegisteredAsLoveReacter(); // false
Updated almost 2 years ago