Journal.php 582 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Journal extends Model
  5. {
  6. protected $table = "journal";
  7. protected $guarded=['id'];
  8. function debit()
  9. {
  10. return $this->belongsTo('App\Models\AccountHead','debit_account');
  11. }
  12. function credit()
  13. {
  14. return $this->belongsTo('App\Models\AccountHead','credit_account');
  15. }
  16. function user()
  17. {
  18. return $this->belongsTo('App\User','created_by');
  19. }
  20. function comment()
  21. {
  22. return $this->hasMany('App\Models\JournalComment','journal_id');
  23. }
  24. }