• File: VoucherHistory.php
  • Full Path: /var/www/sandbox/app/VoucherHistory.php
  • Date Modified: 04/15/2024 8:53 PM
  • File size: 749 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App;

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

class VoucherHistory extends Model
{
    use HasFactory;

    protected $fillable = [
        'status', 'credelec_id', 'water_id', 'voucher_id', 'user_id', 'transaction_type'
    ];

//, 'created_at', 'updated_at'

    function voucher()
    {
        return $this->belongsTo(PurchaseVoucher::class, 'voucher_id');
    }

    function water()
    {
        return $this->belongsTo(Water::class, 'water_id');
    }

    function credelec()
    {
        return $this->belongsTo(Credelec::class, 'credelec_id');
    }

    function user(){
        return $this->belongsTo(User::class);
    }

}