37 lines
711 B
PHP
37 lines
711 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\Contact;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Modules\Project\Entities\Project;
|
|
|
|
class BomEffectivity extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
|
|
protected $table = 'ie_bom_effectivities';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'effective_from' => 'date',
|
|
'effective_to' => 'date',
|
|
];
|
|
|
|
public function bom()
|
|
{
|
|
return $this->belongsTo(Bom::class, 'bom_id');
|
|
}
|
|
|
|
public function customer()
|
|
{
|
|
return $this->belongsTo(Contact::class, 'customer_id');
|
|
}
|
|
|
|
public function project()
|
|
{
|
|
return $this->belongsTo(Project::class, 'project_id');
|
|
}
|
|
}
|