Skip to content

Commit

Permalink
Fix type of hased model property (#1579)
Browse files Browse the repository at this point in the history
* set hashed properity as string

* add to changelog

* add test
  • Loading branch information
khaled-sadek committed Aug 7, 2024
1 parent 591e7d6 commit 643329d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
--------------

### Fixed
- Fix type of hashed model property to `string`

### Changed

Expand Down
1 change: 1 addition & 0 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public function castPropertiesType($model)
break;
case 'decimal':
case 'string':
case 'hashed':
$realType = 'string';
break;
case 'array':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ class SimpleCast extends Model
'cast_to_encrypted_collection' => 'encrypted:collection',
'cast_to_encrypted_json' => 'encrypted:json',
'cast_to_encrypted_object' => 'encrypted:object',
'cast_to_hashed' => 'hashed',
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ class SimpleCast extends Model
'cast_to_encrypted_collection' => 'encrypted:collection',
'cast_to_encrypted_json' => 'encrypted:json',
'cast_to_encrypted_object' => 'encrypted:object',
'cast_to_hashed' => 'hashed',
];
}

0 comments on commit 643329d

Please sign in to comment.