View file ProForum/Files/application/app/Models/PostCommentReport.php

File size: 729B
<?php

namespace App\Models;

use App\Models\Post;
use App\Models\User;
use App\Models\Comment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class PostCommentReport extends Model
{
    use HasFactory;

    protected $guarded= ['id'];
    
    public function scopeRead()
    {
        return $this->where("read","=",0);
    }
    public function post(): BelongsTo
    {
        return $this->belongsTo(Post::class);
    }

    public function comment(): BelongsTo
    {
        return $this->belongsTo(Comment::class);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}