Update single...
$modelA->update(['status_id' => 1])
Update multiple...
ModelA::whereIn('id', $data['ids'])->update(['status_id' => 1])
SO
Updating a model related to a single row can work as follows...
$modelA->relatedModel()->update(['status_id' => 1])
($modelA instance is supplied via route model binding, and the relatedModel() method/relationship is defined in the "ModelA" model)
BUT
When attempting the following,
ModelA::whereIn('id', $data['ids'])->relatedModel()->update(['status_id' => 1])
I get an error
Call to undefined method Illuminate\Database\Eloquent\Builder::relatedModel()
It seems that I am not really understanding what is being returned by
ModelA::whereIn('id', $data['ids'])
So what I'm looking for is a method of updating the related models of multiple rows (obviously without a loop of any kind).