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\Generic as ProductGeneric;
final class Generic extends Type implements SupplierItem
{
protected const category_name = 'Generic';
protected $table = 'supplier_generic';
/* INTERFACES */
public function types()
{
return $this->belongsToMany(ProductGeneric::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int
{
return 1; // Monthly
}
public function products()
{
return $this->hasMany(ProductGeneric::class,'supplier_item_id','id');
}
}