diff --git a/app/Models/Asset.php b/app/Models/Asset.php index ea19ea836e..d588690ba4 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -282,7 +282,7 @@ class Asset extends Depreciable protected function warrantyExpires(): Attribute { return Attribute:: make( - get: fn(mixed $value, array $attributes) => ($attributes['warranty_months'] && $attributes['purchase_date']) ? Carbon::parse($attributes['purchase_date'])->addMonths($attributes['warranty_months']) : null, + get: fn(mixed $value, array $attributes) => ($attributes['warranty_months'] && $attributes['purchase_date']) ? Carbon::parse($attributes['purchase_date'])->addMonths((int)$attributes['warranty_months']) : null, ); }