Save workspace changes
This commit is contained in:
46
.deploy/artwork-evolution-release/app/Models/Report.php
Normal file
46
.deploy/artwork-evolution-release/app/Models/Report.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
use App\Models\ReportHistory;
|
||||
|
||||
class Report extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'reporter_id',
|
||||
'target_type',
|
||||
'target_id',
|
||||
'reason',
|
||||
'details',
|
||||
'status',
|
||||
'moderator_note',
|
||||
'last_moderated_by_id',
|
||||
'last_moderated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'last_moderated_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function reporter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'reporter_id');
|
||||
}
|
||||
|
||||
public function lastModeratedBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'last_moderated_by_id');
|
||||
}
|
||||
|
||||
public function historyEntries(): HasMany
|
||||
{
|
||||
return $this->hasMany(ReportHistory::class)->latest('id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user