Skip to content

Commit

Permalink
feat: use numeric type on fields with decimal casts (#1583)
Browse files Browse the repository at this point in the history
* feat: use `numeric` type on fields with `decimal` casts

* docs: update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
  • Loading branch information
ekisu and barryvdh authored Oct 28, 2024
1 parent 7549f58 commit 800e234
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
### Changed
- Add support for multiple pivot types when using the same accessor.
- Smarter reset, keep tags that IDE helper doesn't use
- Use `numeric` type on fields with `decimal` casts


2024-10-18, 3.2.0
--------------
Expand Down
2 changes: 2 additions & 0 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ public function castPropertiesType($model)
$realType = 'bool';
break;
case 'decimal':
$realType = 'numeric';
break;
case 'string':
case 'hashed':
$realType = 'string';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @property float $cast_to_real
* @property float $cast_to_float
* @property float $cast_to_double
* @property string $cast_to_decimal
* @property numeric $cast_to_decimal
* @property string $cast_to_string
* @property bool $cast_to_bool
* @property bool $cast_to_boolean
Expand Down

0 comments on commit 800e234

Please sign in to comment.