<?php

namespace App\Models;

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

class DesPostBook extends Model
{
    use SoftDeletes;

    protected $table = 'des_post_book';

    protected $primaryKey = 'Dpb_id';

    protected $fillable = [
        'Perm_Post',
        'Temp_Post',
        'Date',
        'Dsg_id'
    ];

    protected $casts = [
        'Perm_Post' => 'decimal:2',
        'Temp_Post' => 'decimal:2',
        'Date'      => 'date:Y-m-d'
    ];

    /**
     * Relationship with Designation
     */
    public function designation()
    {
        return $this->belongsTo(DesignationMaster::class, 'Dsg_id', 'Dsg_id');
    }
}
