35 lines
848 B
PHP
35 lines
848 B
PHP
<?php
|
|
|
|
namespace Modules\Crm\Entities;
|
|
|
|
use App\Product;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CrmCompanyRequirement extends Model
|
|
{
|
|
protected $table = 'crm_company_requirements';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public static function requirementTypes(): array
|
|
{
|
|
return [
|
|
'raw_material' => __('crm::lang.req_raw_material'),
|
|
'technical_service' => __('crm::lang.req_technical_service'),
|
|
'spare_part' => __('crm::lang.req_spare_part'),
|
|
'training' => __('crm::lang.req_training'),
|
|
'warranty' => __('crm::lang.req_warranty'),
|
|
];
|
|
}
|
|
|
|
public function company()
|
|
{
|
|
return $this->belongsTo(CrmCompany::class, 'company_id');
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class, 'product_id');
|
|
}
|
|
}
|