usamamuneerchaudhary /
commentify
| 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
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 |