Enable editing of supplier products and listing services connected to them

This commit is contained in:
Deon George
2022-06-30 23:51:20 +10:00
parent fb416306e7
commit 5297ae8a62
33 changed files with 963 additions and 182 deletions

View File

@@ -8,6 +8,8 @@ use App\Models\TLD;
final class Domain extends Type implements SupplierItem
{
protected const category_name = 'Domain Name';
protected $table = 'supplier_domain';
/* INTERFACES */
@@ -22,9 +24,9 @@ final class Domain extends Type implements SupplierItem
return sprintf('%s: %s',$this->product_id,$this->tld->name);
}
public function types()
public function products()
{
return $this->belongsToMany(ProductDomain::class,$this->table,'id','id','id','supplier_item_id');
return $this->hasMany(ProductDomain::class,'supplier_item_id','id');
}
/* RELATIONS */