79440217

Date: 2025-02-14 18:10:24
Score: 2.5
Natty:
Report link

When updating a pivot table, you are not expected to use attach(), you should use sync or syncWithoutDetaching. This ensure you do not have duplicate entries.

https://laravel.com/docs/11.x/eloquent-relationships#syncing-associations

Reasons:
  • Probably link only (1):
  • Low length (1):
  • Has code block (-0.5):
  • Starts with a question (0.5): When
  • Low reputation (0.5):
Posted by: Soneye Oluwasina