<?php
namespace App\Models;

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

class WONOCEntry extends Model
{
    use SoftDeletes;

    protected $table = 'wonoc_entry';
    protected $primaryKey = 'WNE_Id';

    protected $fillable = [
        'WNE_Date',
        'WA_Id',
        'SL_Id',
        'WNE_HOD',
        'WNE_HDT',
        'Description',
        'Status',
    'Remarks'
    ];

    // protected $dates = ['deleted_at'];

    // Relationships

    public function workAllocation()
    {
        return $this->belongsTo(WorkAllocationBook::class, 'WA_Id', 'WA_Id');
    }

    public function subledger()
    {
        return $this->belongsTo(SubLedgerMaster::class, 'SL_Id', 'SL_Id');
    }

    public function hod()
    {
        return $this->belongsTo(UserMaster::class, 'WNE_HOD', 'Usr_Id');
    }
}
