Expand bill API and v2 account API

This commit is contained in:
James Cole
2023-08-11 06:04:03 +02:00
parent 72c99d3834
commit 4bbc898639
11 changed files with 520 additions and 27 deletions

View File

@@ -29,6 +29,7 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Support\Carbon;
/**
@@ -106,6 +107,16 @@ class UserGroup extends Model
return $this->hasMany(GroupMembership::class);
}
/**
* Link to piggy banks.
*
* @return HasManyThrough
*/
public function piggyBanks(): HasManyThrough
{
return $this->hasManyThrough(PiggyBank::class, Account::class);
}
/**
* Link to transaction journals.
*