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']]);
            }
        }
    }
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']]);
            }
        }
    }
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' ] ] ) ; } } }
Update the model pictures.

@param  array $pictures

@return array
Update the model pictures .