|
@@ -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
|
}
|