Andrew Wallo 5 个月前
父节点
当前提交
68661b6e2b
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1
    3
      app/Casts/DocumentMoneyCast.php

+ 1
- 3
app/Casts/DocumentMoneyCast.php 查看文件

@@ -33,14 +33,12 @@ class DocumentMoneyCast implements CastsAttributes
33 33
      */
34 34
     public function set(Model $model, string $key, mixed $value, array $attributes): mixed
35 35
     {
36
-        $currency_code = $attributes['currency_code'] ?? CurrencyAccessor::getDefaultCurrency();
37
-
38 36
         if (is_numeric($value)) {
39 37
             $value = (string) $value;
40 38
         } elseif (! is_string($value)) {
41 39
             throw new UnexpectedValueException('Expected string or numeric value for money cast');
42 40
         }
43 41
 
44
-        return CurrencyConverter::prepareForAccessor($value, $currency_code);
42
+        return CurrencyConverter::prepareForAccessor($value, 'USD');
45 43
     }
46 44
 }

正在加载...
取消
保存