James Cole 2022-12-31 15:56:36 +01:00
parent f2499e0a77
commit 15605dd163
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -26,6 +26,7 @@ use Carbon\Carbon;
use Eloquent;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
@ -290,4 +291,16 @@ class Account extends Model
{
return $this->belongsTo(User::class);
}
/**
* Get the virtual balance
*
* @return Attribute
*/
protected function virtualBalance(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
);
}
}