36 lines
713 B
PHP
36 lines
713 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PartEquivalent extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
|
|
protected $table = 'ie_part_equivalents';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'is_approved' => 'boolean',
|
|
'approved_at' => 'datetime',
|
|
];
|
|
|
|
public function primaryItem()
|
|
{
|
|
return $this->belongsTo(ItemMaster::class, 'primary_item_id');
|
|
}
|
|
|
|
public function equivalentItem()
|
|
{
|
|
return $this->belongsTo(ItemMaster::class, 'equivalent_item_id');
|
|
}
|
|
|
|
public function approvedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'approved_by');
|
|
}
|
|
}
|