morphTo(); } /** * Get the account that owns the Transaction */ public function account(): BelongsTo { return $this->belongsTo(Account::class); } public function getAccountTypeAttribute(): string { return $this->account->type; } /** * Get the ledgers associated with the Transaction * * @return HasOne */ public function ledgers(): HasMany { return $this->hasMany(Ledger::class); } public function branch(): BelongsTo { return $this->belongsTo(Branch::class); } }