41 lines
818 B
PHP
41 lines
818 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ForumPostReport extends Model
|
|
{
|
|
protected $table = 'forum_post_reports';
|
|
|
|
protected $fillable = [
|
|
'post_id',
|
|
'thread_id',
|
|
'reporter_user_id',
|
|
'reason',
|
|
'status',
|
|
'source_url',
|
|
'reported_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'reported_at' => 'datetime',
|
|
];
|
|
|
|
public function post(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ForumPost::class, 'post_id');
|
|
}
|
|
|
|
public function thread(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ForumThread::class, 'thread_id');
|
|
}
|
|
|
|
public function reporter(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'reporter_user_id');
|
|
}
|
|
}
|