2022-02-01 05:40:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Product;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
use App\Models\Product;
|
|
|
|
use App\Traits\{OrderServiceOptions,SiteID};
|
|
|
|
|
2022-04-19 07:07:39 +00:00
|
|
|
/**
|
|
|
|
* @todo These tables have a base_cost/setup_cost/contract_term columns - how is that different to the supplier_tables?
|
2022-04-22 00:36:41 +00:00
|
|
|
* @todo Ensure our terminology is consistent - we have a "cost", we "charge" clients, and we have a "price" which is not official charges nor a cost.
|
2022-04-19 07:07:39 +00:00
|
|
|
*/
|
2022-02-01 05:40:46 +00:00
|
|
|
abstract class Type extends Model
|
|
|
|
{
|
|
|
|
use SiteID,OrderServiceOptions;
|
|
|
|
|
|
|
|
/* RELATIONS */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The product that sells this type
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\MorphOne
|
|
|
|
*/
|
|
|
|
public function product()
|
|
|
|
{
|
|
|
|
return $this->morphOne(Product::class, null,'model','model_id');
|
|
|
|
}
|
|
|
|
}
|