original_string: protected function addWithDecryptKey(Builder $builder)
      {
          $builder->macro('withDecryptKey', function (Builder $builder, $decryptKey) {
              $model = $builder->getModel();
              $encryptedFields = $model::getEncryptedFields();
              if (!empty($encryptedFields)) {
                  $builder->setEncryptionModel($model);
  
                  /** @var DatabaseEncryptionServiceInterface $encryptionService */
                  $encryptionService = $model::getEncryptionService();
                  foreach ($encryptedFields as $encryptedField) {
                      $decryptStmt = $encryptionService->getDecryptExpression($encryptedField, $decryptKey);
                      $builder->addEncryptionSelect([
                          'column' => $encryptedField,
                          'select' => DB::raw("$decryptStmt as $encryptedField")
                      ]);
                  }
              }
              return $builder;
          });
      }
code: protected function addWithDecryptKey(Builder $builder)
      {
          $builder->macro('withDecryptKey', function (Builder $builder, $decryptKey) {
              $model = $builder->getModel();
              $encryptedFields = $model::getEncryptedFields();
              if (!empty($encryptedFields)) {
                  $builder->setEncryptionModel($model);
  
                  /** @var DatabaseEncryptionServiceInterface $encryptionService */
                  $encryptionService = $model::getEncryptionService();
                  foreach ($encryptedFields as $encryptedField) {
                      $decryptStmt = $encryptionService->getDecryptExpression($encryptedField, $decryptKey);
                      $builder->addEncryptionSelect([
                          'column' => $encryptedField,
                          'select' => DB::raw("$decryptStmt as $encryptedField")
                      ]);
                  }
              }
              return $builder;
          });
      }
code_tokens: protected function addWithDecryptKey ( Builder $ builder ) { $ builder -> macro ( 'withDecryptKey' , function ( Builder $ builder , $ decryptKey ) { $ model = $ builder -> getModel ( ) ; $ encryptedFields = $ model :: getEncryptedFields ( ) ; if ( ! empty ( $ encryptedFields ) ) { $ builder -> setEncryptionModel ( $ model ) ; /** @var DatabaseEncryptionServiceInterface $encryptionService */ $ encryptionService = $ model :: getEncryptionService ( ) ; foreach ( $ encryptedFields as $ encryptedField ) { $ decryptStmt = $ encryptionService -> getDecryptExpression ( $ encryptedField , $ decryptKey ) ; $ builder -> addEncryptionSelect ( [ 'column' => $ encryptedField , 'select' => DB :: raw ( "$decryptStmt as $encryptedField" ) ] ) ; } } return $ builder ; } ) ; }
docstring: Add the with-decrypt-key extension to the builder.
  
  @param  \Illuminate\Database\Eloquent\Builder $builder
  @return void
docstring_tokens: Add the with - decrypt - key extension to the builder .