Return amount as string

This commit is contained in:
James Cole 2022-08-01 19:51:45 +02:00
parent b39e16c51c
commit 75ea1c4f4b
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -24,6 +24,7 @@ namespace FireflyIII\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
@ -97,4 +98,16 @@ class PiggyBankEvent extends Model
{
return $this->belongsTo(TransactionJournal::class);
}
/**
* Get the amount
*
* @return Attribute
*/
protected function amount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
);
}
}