Skip to content

Commit 643329d

Browse files
authored
Fix type of hased model property (#1579)
* set hashed properity as string * add to changelog * add test
1 parent 591e7d6 commit 643329d

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
66
--------------
77

88
### Fixed
9+
- Fix type of hashed model property to `string`
910

1011
### Changed
1112

src/Console/ModelsCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ public function castPropertiesType($model)
382382
break;
383383
case 'decimal':
384384
case 'string':
385+
case 'hashed':
385386
$realType = 'string';
386387
break;
387388
case 'array':

tests/Console/ModelsCommand/SimpleCasts/Models/SimpleCast.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ class SimpleCast extends Model
3939
'cast_to_encrypted_collection' => 'encrypted:collection',
4040
'cast_to_encrypted_json' => 'encrypted:json',
4141
'cast_to_encrypted_object' => 'encrypted:object',
42+
'cast_to_hashed' => 'hashed',
4243
];
4344
}

tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ class SimpleCast extends Model
105105
'cast_to_encrypted_collection' => 'encrypted:collection',
106106
'cast_to_encrypted_json' => 'encrypted:json',
107107
'cast_to_encrypted_object' => 'encrypted:object',
108+
'cast_to_hashed' => 'hashed',
108109
];
109110
}

0 commit comments

Comments
 (0)