| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | class CommentLike extends Model |
||
| 16 | { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $table = 'comment_likes'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string[] |
||
| 25 | */ |
||
| 26 | protected $fillable = [ |
||
| 27 | 'user_id', |
||
| 28 | 'ip', |
||
| 29 | 'user_agent', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | |||
| 33 | /** |
||
| 34 | * @param $query |
||
| 35 | * @param string $ip |
||
| 36 | * @return mixed |
||
| 37 | */ |
||
| 38 | public function scopeForIp($query, string $ip): mixed |
||
| 39 | { |
||
| 40 | return $query->where('ip', $ip); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param $query |
||
| 45 | * @param string $userAgent |
||
| 46 | * @return mixed |
||
| 47 | */ |
||
| 48 | public function scopeForUserAgent($query, string $userAgent): mixed |
||
| 51 | } |
||
| 52 | |||
| 54 |