James Cole
2022-07-24 05:44:35 +02:00
parent d8506c4361
commit 76dadd1cab
4 changed files with 64 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Models;
use Eloquent;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -223,4 +224,28 @@ class Bill extends Model
{
return $this->belongsTo(User::class);
}
/**
* Get the max amount
*
* @return Attribute
*/
protected function amountMax(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
);
}
/**
* Get the min amount
*
* @return Attribute
*/
protected function amountMin(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
);
}
}