<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Journal extends Model
{
    protected $table = "journal";
    protected $guarded=['id'];


    function debit()
    {
        return $this->belongsTo('App\Models\AccountHead','debit_account');
    }

    function credit()
    {
        return $this->belongsTo('App\Models\AccountHead','credit_account');
    }

   function user()
   {
    return $this->belongsTo('App\User','created_by');
   }

    function comment()
    {
        return $this->hasMany('App\Models\JournalComment','journal_id');
    }

}