---
agentTools:
  projectIndex: https://laravel-love.readme.io/llms.txt
---

# Reacter Facade

In examples below `User` model is a `Reacterable` and `Comment` model is a `Reactable`.

```php
$reacterFacade = $user->viaLoveReacter();
```

## React to Reactable

```php
$reacterFacade->reactTo($comment, 'Like');
```

Reaction weight could be affected by `$rate` value:

```php
$reacterFacade->reactTo($comment, 'Like', 4.0);
```

> 📘
>
> Minimum `$rate` value is `0.01`.\
> Maximum `$rate` value is `99.99`.

## Remove Reaction from Reactable

```php
$reacterFacade->unreactTo($comment, 'Like');
```

## Check if Reacterable Reacted to Reactable

Determine if `User` reacted to `Comment` with any type of reaction.

```php
$isReacted = $reacterFacade->hasReactedTo($comment);

$isNotReacted = $reacterFacade->hasNotReactedTo($comment);
```

Determine if `User` reacted to `Comment` with exact type of reaction.

```php
$isReacted = $reacterFacade->hasReactedTo($comment, 'Like');

$isNotReacted = $reacterFacade->hasNotReactedTo($comment, 'Like');
```

Determine if `User` reacted to `Comment` with exact type of reaction and exact `rate` value.

```php
$isReacted = $reacterFacade->hasReactedTo($comment, 'Like', 4.0);

$isNotReacted = $reacterFacade->hasNotReactedTo($comment, 'Like', 4.0);
```

## Get Reactions Which Reacterable Has Made

```php
$reactions = $reacterFacade->getReactions();
```