<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Safe_History extends Model
{
    public $timestamps = true;
    protected $table = 'safe_history';
    protected $fillable = [
       'balance_before','balance_after','descreption','receipt_id','created_at',
       'updated_at','user_id','payment_voucher_id','invoice_id','safe_account_id','movement_type','payment_method_id','income','outcome','client_id'
    ];


    public function safe_account()
    {
        return $this->belongsTo('App\Safe_Account', 'safe_account_id');
    }

    public function client()
    {
        return $this->belongsTo('App\Client', 'client_id');
    }

    public function receipt()
    {
        return $this->belongsTo('App\Receipt', 'receipt_id');
    }

    public function payment_voucher()
    {
        return $this->belongsTo('App\Payment_Voucher', 'payment_voucher_id');
    }
    public function user()
    {
        return $this->belongsTo('App\User', 'user_id');
    }
}

