Interresting....
That's the next step.
Well, you can fork the syncRelation() function in the item model.
At the moment Cook do not propose it, because there is no input for that. It must be custom design as you did.
It is a good idea to implement. (At least in the model class)
Please do it as I tell you now : (I will implement it in future)
$values parameter is a simple array of values at the moment.
So, let's make $array recieving sub arrays as follow :
Ex:
$values = array(
'23' => array(
'quantity' => '2',
),
'52' => array(
'quantity' => '4',
),
);
First, the function extract the ids from array_keys($values) (when recognized necessary)
And then , for every link, you get the datas to populate in the Pivot. ($model->save())
It is really simple to achieve.
For you, you do not need to change code in the $raw mode if you don't use it. I will do it.
It is a good exercice. Once you have put your hands in syncRelations(), then you will understand pretty well the process.
Not a big deal in facts.
By the way, excellent hint. I love to break the limits when it is usefull.