original_string: protected function updateProductsFeatures(array $attributes, $products)
      {
          $products->each(function ($item, $key) use ($attributes, $products) {
              $item->update(['features' => json_encode($attributes[$item->id])]);
              $item->save();
          });
      }
code: protected function updateProductsFeatures(array $attributes, $products)
      {
          $products->each(function ($item, $key) use ($attributes, $products) {
              $item->update(['features' => json_encode($attributes[$item->id])]);
              $item->save();
          });
      }
code_tokens: protected function updateProductsFeatures ( array $ attributes , $ products ) { $ products -> each ( function ( $ item , $ key ) use ( $ attributes , $ products ) { $ item -> update ( [ 'features' => json_encode ( $ attributes [ $ item -> id ] ) ] ) ; $ item -> save ( ) ; } ) ; }
docstring: Update the given products features with the passed attributes.
  
  @param  array $attributes
  @param  \Illuminate\Database\Eloquent\Collection $products
  
  @return void
docstring_tokens: Update the given products features with the passed attributes .