<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class PrintQueue extends Model {
    // protected $guarded=['id'];
    // protected $casts=['queued_at'=>'datetime','printed_at'=>'datetime'];
    // public function cheque(){return $this->belongsTo(Cheque::class);}

       use SoftDeletes;

    protected $table = 'print_queues';

    protected $primaryKey = 'print_queues_id';

    protected $guarded = ['print_queues_id'];

    protected $casts = [
        'queued_at'  => 'datetime',
        'printed_at' => 'datetime',
    ];

    public function cheque()
    {
        return $this->belongsTo(
            Cheque::class,
            'cheque_id',
            'cheque_id'
        );
    }

    public function statusAction()
    {
        return $this->belongsTo(
            ActionMaster::class,
            'status',
            'Act_Id'
        );
    }
}
