Open Siebov opened 6 years ago
Hello. You are using
RecipeIngredient::whereNotIn('id',$ingredients_updated) ->where('recipe_id',$recipe->id) ->delete(); RecipeDirection::whereNotIn('id',$directions_updated) ->where('recipe_id',$recipe->id) ->delete();
and why not just
$recipe->ingredients()->sync($ingredients_updated); $recipe->directions()->sync($directions_updated);
insted?
@Sebbba i didnt know about this. Are you sure this works? I will test this later
@anishdcruz https://laravel.com/docs/5.5/eloquent-relationships Syncing Associations - chapter.
Hello. You are using
and why not just
insted?