Reputation: 51
I have a products table and pivot table product collection. Now i want to save only the records in the pivot table that does,t contains any duplicate entry in pivot table from product table .
Upvotes: 0
Views: 26
Reputation: 2052
You cab use sync()
method to avoid duplicate entry. This method will remove the old records that doesn't exits in form data and it add new rows if the form data have new values.
Upvotes: 1