Enable editing of supplier products and listing services connected to them
This commit is contained in:
@@ -10,6 +10,8 @@ use App\Models\Product\Broadband as ProductBroadband;
|
||||
|
||||
class Broadband extends Type implements SupplierItem
|
||||
{
|
||||
protected const category_name = 'Broadband';
|
||||
|
||||
protected $casts = [
|
||||
'offpeak_start' => 'datetime:H:i',
|
||||
'offpeak_end' => 'datetime:H:i',
|
||||
@@ -35,16 +37,16 @@ class Broadband extends Type implements SupplierItem
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
public function types()
|
||||
{
|
||||
return $this->belongsToMany(ProductBroadband::class,$this->table,'id','id','id','supplier_item_id');
|
||||
}
|
||||
|
||||
public function getBillingIntervalAttribute(): int
|
||||
{
|
||||
return 1; // Monthly
|
||||
}
|
||||
|
||||
public function products()
|
||||
{
|
||||
return $this->hasMany(ProductBroadband::class,'supplier_item_id','id');
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
/**
|
||||
@@ -156,14 +158,4 @@ class Broadband extends Type implements SupplierItem
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Broadband Speed
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function speed(): string
|
||||
{
|
||||
return $this->speed;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user