belongsTo(ProductProxy::modelClass()); } /** * Get the product that owns the product. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function parent() { return $this->belongsTo(self::class, 'parent_id'); } /** * Get the product variants that owns the product. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function variants() { return $this->hasMany(static::class, 'parent_id'); } /** * Retrieve type instance. * * @return \Webkul\Product\Type\AbstractType */ public function getTypeInstance() { return $this->product->getTypeInstance(); } }