Example #1
0
 public function syncPhotos(Tour $tour, array $photoIds)
 {
     $tour_id = $tour->id;
     $tour->photos()->delete();
     foreach ($photoIds as $photo_id) {
         Photo::create(compact('tour_id', 'photo_id'));
     }
 }