pimous
303
1
Laravel

Sync with array, data and pivot

Posted 3 years ago by pimous

Hi, How can I do a multi sync ?

Because I have two sync, it's work separately but not together ... This is my code :

$product->pictures()->sync([$request->get('mainPicture') => ['main'=>'1',]]);
$product->pictures()->sync($request->get('gallery'));

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.