Category: Laravel

It is similar to the attach() method and it also use to attach related models. sync() method accepts an array of IDs to place on the pivot table.If the models doesnot exist in array the sync method will delete models from table and insert new items to the pivot table.

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Community Partners