From fafe264b3cd0e4e6f8940531ea4eae327ec37ef0 Mon Sep 17 00:00:00 2001 From: Pieter Willekens Date: Thu, 17 Jul 2025 08:06:36 +0200 Subject: [PATCH] fix(ModelsCommand): use 'string' as realType for 'encrypted' casts (#1698) --- src/Console/ModelsCommand.php | 4 +--- .../AdvancedCasts/__snapshots__/Test__test__1.php | 2 +- .../ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 1d08ebc..8866a0f 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -410,9 +410,6 @@ class ModelsCommand extends Command $params = []; switch ($type) { - case 'encrypted': - $realType = 'mixed'; - break; case 'boolean': case 'bool': $realType = 'bool'; @@ -420,6 +417,7 @@ class ModelsCommand extends Command case 'decimal': $realType = 'numeric'; break; + case 'encrypted': case 'string': case 'hashed': $realType = 'string'; diff --git a/tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php index a1ea211..e5873ef 100644 --- a/tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php +++ b/tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php @@ -22,7 +22,7 @@ use Illuminate\Database\Eloquent\Model; * @property \Carbon\CarbonImmutable $cast_to_immutable_custom_datetime * @property \Carbon\CarbonImmutable $cast_to_immutable_datetime * @property int $cast_to_timestamp - * @property mixed $cast_to_encrypted + * @property string $cast_to_encrypted * @property array $cast_to_encrypted_array * @property \Illuminate\Support\Collection $cast_to_encrypted_collection * @property array $cast_to_encrypted_json diff --git a/tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php index 3041ecf..b18dac9 100644 --- a/tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php +++ b/tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php @@ -33,7 +33,7 @@ use Illuminate\Database\Eloquent\Model; * @property \Carbon\CarbonImmutable $cast_to_immutable_datetime * @property \Carbon\CarbonImmutable $cast_to_immutable_datetime_serialization * @property int $cast_to_timestamp - * @property mixed $cast_to_encrypted + * @property string $cast_to_encrypted * @property array $cast_to_encrypted_array * @property \Illuminate\Support\Collection $cast_to_encrypted_collection * @property array $cast_to_encrypted_json