original_string: public function updatePictures($pictures)
      {
          foreach ($pictures as $picture) {
              $image = $this->pictures()->where('id', $picture['id']);
  
              if ($image->exists()){
                 $image->update(['path' => $picture['path']]);
              } else {
                 $this->pictures()->create(['path' => $picture['path']]);
              }
          }
      }
code: public function updatePictures($pictures)
      {
          foreach ($pictures as $picture) {
              $image = $this->pictures()->where('id', $picture['id']);
  
              if ($image->exists()){
                 $image->update(['path' => $picture['path']]);
              } else {
                 $this->pictures()->create(['path' => $picture['path']]);
              }
          }
      }
code_tokens: public function updatePictures ( $ pictures ) { foreach ( $ pictures as $ picture ) { $ image = $ this -> pictures ( ) -> where ( 'id' , $ picture [ 'id' ] ) ; if ( $ image -> exists ( ) ) { $ image -> update ( [ 'path' => $ picture [ 'path' ] ] ) ; } else { $ this -> pictures ( ) -> create ( [ 'path' => $ picture [ 'path' ] ] ) ; } } }
docstring: Update the model pictures.
  
  @param  array $pictures
  
  @return array
docstring_tokens: Update the model pictures .