In this case directly calculate the value of the attribute and assign it to `$model->$attribute`.