<?php

namespace App\Models;

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

class DeletedPayment extends Model
{
    use HasFactory;
    protected $fillable = [
        'id',
        'cover_id',
        'payment_method',
        'cash_tendered',
        'months',
        'change',
        'member_id',
        'payment_date',
        'user_id',
        'amount_paid',
        'submission_status',
        'satus',
        'cash',
        'deleted_by',
        'deleted_at',
    ];

    public function member()
    {
        return $this->belongsTo('App\Models\Member', 'member_id');
    }

    public function mode()
    {
        return $this->belongsTo('App\Models\Payment_mode', 'payment_method');
    }

    public function cover()
    {
        return $this->belongsTo('App\Models\Cover', 'cover_id');
    }
    
    public function agent()
    {
        return $this->belongsTo('App\Models\User', 'user_id');
    }

    public function by()
    {
        return $this->belongsTo('App\Models\User', 'deleted_by');
    }
}
