$attributes */ public function get(Model $model, string $key, mixed $value, array $attributes): mixed { if ($value === null) { return null; } try { $decrypted = $this->getEncrypter()->decryptString($value); return json_decode($decrypted, true); } catch (Exception $e) { // Return null or throw depending on how strict we want to be. return null; } } /** * Prepare the given value for storage. * * @param array $attributes */ public function set(Model $model, string $key, mixed $value, array $attributes): mixed { if ($value === null) { return null; } $json = json_encode($value); return $this->getEncrypter()->encryptString($json); } }