diff --git a/tests/etc/EncryptedCast.php b/tests/etc/EncryptedCast.php new file mode 100644 index 0000000..ad61413 --- /dev/null +++ b/tests/etc/EncryptedCast.php @@ -0,0 +1,30 @@ + $attributes + */ + public function get(Model $model, string $key, mixed $value, array $attributes): mixed + { + return Crypt::decryptString($value); + } + + /** + * Prepare the given value for storage. + * + * @param array $attributes + */ + public function set(Model $model, string $key, mixed $value, array $attributes): mixed + { + return Crypt::encryptString($value); + } +}