public static function merge(Model $model1, Model $model2, array $attributes) { foreach ($attributes as $attribute) { $model1->{$attribute} = $model2->{$attribute}; } return $model1; }