mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 08:56:39 -06:00
Add related models.
This commit is contained in:
parent
cebfaa32bf
commit
c741b2a819
@ -193,6 +193,11 @@ class Account extends Model
|
||||
return $this->hasMany(AccountMeta::class);
|
||||
}
|
||||
|
||||
public function accountBalances(): HasMany
|
||||
{
|
||||
return $this->hasMany(AccountBalance::class);
|
||||
}
|
||||
|
||||
public function getEditNameAttribute(): string
|
||||
{
|
||||
$name = $this->name;
|
||||
|
@ -4,9 +4,16 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AccountBalance extends Model
|
||||
{
|
||||
protected $fillable = ['account_id', 'transaction_currency_id', 'balance'];
|
||||
use HasFactory;
|
||||
|
||||
|
||||
public function account(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Account::class);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user