Check if entity is reacted by given user
piterjov opened this issue · comments
Petar commented
public function isReactedBy($responder = null)
{
if (is_null($responder)) {
$responder = auth()->user();
}
return $this->reactions()
->where('responder_id', $responder->id)
->where('responder_type', get_class($responder))->exists();
}