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]>
This commit is contained in:
Ramon Dantas
2024-10-28 12:32:31 +01:00
committed by GitHub
co-authored by Barry vd. Heuvel
parent 7549f58a30
commit 800e2347a6
3 changed files with 5 additions and 1 deletions
+2
View File
@@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
### Changed ### Changed
- Add support for multiple pivot types when using the same accessor. - Add support for multiple pivot types when using the same accessor.
- Smarter reset, keep tags that IDE helper doesn't use - Smarter reset, keep tags that IDE helper doesn't use
- Use `numeric` type on fields with `decimal` casts
2024-10-18, 3.2.0 2024-10-18, 3.2.0
-------------- --------------
+2
View File
@@ -381,6 +381,8 @@ class ModelsCommand extends Command
$realType = 'bool'; $realType = 'bool';
break; break;
case 'decimal': case 'decimal':
$realType = 'numeric';
break;
case 'string': case 'string':
case 'hashed': case 'hashed':
$realType = 'string'; $realType = 'string';
@@ -14,7 +14,7 @@ use Illuminate\Database\Eloquent\Model;
* @property float $cast_to_real * @property float $cast_to_real
* @property float $cast_to_float * @property float $cast_to_float
* @property float $cast_to_double * @property float $cast_to_double
* @property string $cast_to_decimal * @property numeric $cast_to_decimal
* @property string $cast_to_string * @property string $cast_to_string
* @property bool $cast_to_bool * @property bool $cast_to_bool
* @property bool $cast_to_boolean * @property bool $cast_to_boolean