belongsTo(Variation::class)->withTrashed(); } public function getNameAttribute() { return $this->variation->name; } public function storeValues($values) { $this->values()->attach($values->pluck('id')); } public function values() { return $this->belongsToMany(VariationValue::class, 'order_product_variation_values') ->using(OrderProductVariationValue::class); } }