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,17 +7,19 @@ use App\Models\Product\Phone as ProductVoip;
final class Phone extends Type implements SupplierItem
{
protected const category_name = 'Telephone';
protected $table = 'supplier_phone';
/* INTERFACES */
public function types()
{
return $this->belongsToMany(ProductVoip::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int
{
return 1; // Monthly
}
public function products()
{
return $this->hasMany(ProductVoip::class,'supplier_item_id','id');
}
}