42 lines
848 B
PHP
42 lines
848 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class BomChangeRequest extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'ie_bom_change_requests';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'reviewed_at' => 'datetime',
|
|
];
|
|
|
|
public function bom()
|
|
{
|
|
return $this->belongsTo(Bom::class, 'bom_id');
|
|
}
|
|
|
|
public function lineRevision()
|
|
{
|
|
return $this->belongsTo(LineRevision::class, 'line_revision_id');
|
|
}
|
|
|
|
public function changeOrders()
|
|
{
|
|
return $this->hasMany(BomChangeOrder::class, 'change_request_id');
|
|
}
|
|
|
|
public function requestedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'requested_by');
|
|
}
|
|
}
|