<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Notification extends Model
{
    use HasFactory;

    protected $table = 'tbl_notification';
    protected $guarded = array();

    protected $casts = [
        'id' => 'integer',
        'type' => 'integer',
        'recipient_id' => 'integer',
        'complaint_id' => 'integer',
        'title' => 'string',
        'message' => 'string',
        'image' => 'string',
    ];
    public function complaint()
    {
        return $this->belongsTo(Complaint::class, 'complaint_id');
    }
    public function user()
    {
        return $this->belongsTo(User::class, 'recipient_id');
    }
    public function sub_in_charge()
    {
        return $this->belongsTo(Sub_In_Charge::class, 'recipient_id');
    }
}
