<?php

namespace App\Models;

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

class Payments extends Model
{
    use HasFactory;

    protected $fillable = [
        'PAYMENT_REF',
        'PAYMENT_MODE',
        'AMOUNT',
        'TOKENS',
        'contract_id',
        'USER_ID'
    ];

    //RELATION
    public function contract (): BelongsTo
    {
        return $this->belongsTo(Contract::class,'contract_id', 'rid');
    }

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

}
