24 lines
433 B
PHP
24 lines
433 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Account extends Model
|
|
{
|
|
protected $fillable = [
|
|
'date', 'time', 'credit', 'debit', 'type',
|
|
'branch_id', 'accountable_id', 'accountable_type', 'description'
|
|
];
|
|
|
|
public function branch()
|
|
{
|
|
return $this->belongsTo(Branch::class);
|
|
}
|
|
|
|
public function accountable()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|