<?php

namespace App\Models;

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

class CompanySubModesOfPayment extends Model
{
    use HasFactory, softDeletes;

    protected $guarded = ['id'];

    /**Each Sub-Mode is created by a specific User**/
    public function user(){
        return $this->belongsTo(User::class, 'created_by', 'id');
    }

    /**Each Sub-Mode belongs to ap articular Mode**/
    public function modeDetails(){
        return $this->belongsTo(CompanyMainPaymentMode::class, 'mode_id', 'id');
    }
}
