CommentReport::comment()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Usamamuneerchaudhary\Commentify\Models;
4
5
use Illuminate\Database\Eloquent\Factories\HasFactory;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Relations\BelongsTo;
8
9
class CommentReport extends Model
10
{
11
    use HasFactory;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Database\Eloquent\Factories\HasFactory requires the property $factoryClass which is not provided by Usamamuneerchaudhary\Com...fy\Models\CommentReport.
Loading history...
12
13
    /**
14
     * @var string
15
     */
16
    protected $table = 'comment_reports';
17
18
    /**
19
     * @var string[]
20
     */
21
    protected $fillable = [
22
        'comment_id',
23
        'user_id',
24
        'ip',
25
        'user_agent',
26
        'reason',
27
        'status',
28
        'reviewed_by',
29
        'reviewed_at',
30
    ];
31
32
    /**
33
     * @var string[]
34
     */
35
    protected $casts = [
36
        'reviewed_at' => 'datetime',
37
    ];
38
39
    /**
40
     * @return BelongsTo
41
     */
42
    public function comment(): BelongsTo
43
    {
44
        return $this->belongsTo(Comment::class);
45
    }
46
47
    /**
48
     * @return BelongsTo
49
     */
50
    public function user(): BelongsTo
51
    {
52
        return $this->belongsTo(User::class);
53
    }
54
55
    /**
56
     * @return BelongsTo
57
     */
58
    public function reviewer(): BelongsTo
59
    {
60
        return $this->belongsTo(User::class, 'reviewed_by');
61
    }
62
}
63
64