| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 51 | public function removeLike(): bool |
||
| 52 | { |
||
| 53 | $ip = request()->ip(); |
||
| 54 | $userAgent = request()->userAgent(); |
||
| 55 | if (auth()->user()) { |
||
| 56 | return $this->likes()->where('user_id', auth()->user()->id)->where('comment_id', $this->id)->delete(); |
||
| 57 | } |
||
| 58 | |||
| 59 | if ($ip && $userAgent) { |
||
| 60 | return $this->likes()->forIp($ip)->forUserAgent($userAgent)->delete(); |
||
| 61 | } |
||
| 62 | |||
| 63 | return false; |
||
| 64 | } |
||
| 66 |