Skip to content

Commit 1ab63d0

Browse files
committed
fix(ModelsCommand): use 'string' as realType for 'encrypted' casts
1 parent 5bd5219 commit 1ab63d0

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/Console/ModelsCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,14 @@ public function castPropertiesType($model)
410410
$params = [];
411411

412412
switch ($type) {
413-
case 'encrypted':
414-
$realType = 'mixed';
415-
break;
416413
case 'boolean':
417414
case 'bool':
418415
$realType = 'bool';
419416
break;
420417
case 'decimal':
421418
$realType = 'numeric';
422419
break;
420+
case 'encrypted':
423421
case 'string':
424422
case 'hashed':
425423
$realType = 'string';

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @property \Carbon\CarbonImmutable $cast_to_immutable_custom_datetime
2222
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
2323
* @property int $cast_to_timestamp
24-
* @property mixed $cast_to_encrypted
24+
* @property string $cast_to_encrypted
2525
* @property array<array-key, mixed> $cast_to_encrypted_array
2626
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
2727
* @property array<array-key, mixed> $cast_to_encrypted_json

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
3434
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime_serialization
3535
* @property int $cast_to_timestamp
36-
* @property mixed $cast_to_encrypted
36+
* @property string $cast_to_encrypted
3737
* @property array<array-key, mixed> $cast_to_encrypted_array
3838
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
3939
* @property array<array-key, mixed> $cast_to_encrypted_json

0 commit comments

Comments
 (0)