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

@@ -7,6 +7,8 @@ use App\Models\Product\Email as ProductEmail;
final class Email extends Type implements SupplierItem
{
protected const category_name = 'Email Hosting';
protected $table = 'supplier_email';
/* INTERFACES */
@@ -16,8 +18,8 @@ final class Email extends Type implements SupplierItem
return 4; // Yearly
}
public function types()
public function products()
{
return $this->belongsToMany(ProductEmail::class,$this->table,'id','id','id','supplier_item_id');
return $this->hasMany(ProductEmail::class,$this->table,'supplier_item_id','id');
}
}