James Cole 2022-11-02 04:46:06 +01:00
parent 0c6e00666b
commit 8f15bd716d
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Models; namespace FireflyIII\Models;
use Eloquent; use Eloquent;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -154,7 +155,7 @@ class PiggyBank extends Model
} }
/** /**
* Get all of the tags for the post. * Get all the tags for the post.
*/ */
public function objectGroups() public function objectGroups()
{ {
@ -188,4 +189,16 @@ class PiggyBank extends Model
{ {
$this->attributes['targetamount'] = (string) $value; $this->attributes['targetamount'] = (string) $value;
} }
/**
* Get the max amount
*
* @return Attribute
*/
protected function targetamount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
);
}
} }