1 year ago

Updating multiple many to many relationships

Posted 1 year ago by DevinSephone

I am wondering if there is a best practice when it comes to updating the pivot table for a many to many relationship. I currently have the following code which updates each pivot table record individually, but wonder if there is a better way to do this?

foreach( $job->codes as $code ) {
            'approved' => 1

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