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
 }

読み込み中…
キャンセル
保存