Andrew Wallo 7 months ago
parent
commit
68661b6e2b
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      app/Casts/DocumentMoneyCast.php

+ 1
- 3
app/Casts/DocumentMoneyCast.php View File

33
      */
33
      */
34
     public function set(Model $model, string $key, mixed $value, array $attributes): mixed
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
         if (is_numeric($value)) {
36
         if (is_numeric($value)) {
39
             $value = (string) $value;
37
             $value = (string) $value;
40
         } elseif (! is_string($value)) {
38
         } elseif (! is_string($value)) {
41
             throw new UnexpectedValueException('Expected string or numeric value for money cast');
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
 }

Loading…
Cancel
Save