Skip to content

Commit 800e234

Browse files
ekisubarryvdh
andauthored
feat: use numeric type on fields with decimal casts (#1583)
* feat: use `numeric` type on fields with `decimal` casts * docs: update CHANGELOG.md --------- Co-authored-by: Barry vd. Heuvel <[email protected]>
1 parent 7549f58 commit 800e234

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
88
### Changed
99
- Add support for multiple pivot types when using the same accessor.
1010
- Smarter reset, keep tags that IDE helper doesn't use
11+
- Use `numeric` type on fields with `decimal` casts
12+
1113

1214
2024-10-18, 3.2.0
1315
--------------

Diff for: src/Console/ModelsCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ public function castPropertiesType($model)
381381
$realType = 'bool';
382382
break;
383383
case 'decimal':
384+
$realType = 'numeric';
385+
break;
384386
case 'string':
385387
case 'hashed':
386388
$realType = 'string';

Diff for: tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @property float $cast_to_real
1515
* @property float $cast_to_float
1616
* @property float $cast_to_double
17-
* @property string $cast_to_decimal
17+
* @property numeric $cast_to_decimal
1818
* @property string $cast_to_string
1919
* @property bool $cast_to_bool
2020
* @property bool $cast_to_boolean

0 commit comments

Comments
 (0)