Possible to UPDATE foreign records via relational AR?

Hey guys,

I know you can read from other models vie relational AR

i.e.


$value = $model->relationName->foreignAttribute

But is it also possible to write to other models via relational AR i.e.


$model->relationName->foreignAttribute = $value

THX

Andreas

Oh sure, it works just fine - but you do have to remember to save after you’ve made your changes. They won’t be saved automatically when the first model is saved:


$model->relationName->save()