22 lines
516 B
PHP
22 lines
516 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class ReferenceUnitConversion extends SigdModel
|
|
{
|
|
protected $table = 'unit_conversion';
|
|
protected $fillable = [
|
|
'id', 'category', 'from_unit_code', 'to_unit_code', 'value', 'row_status', 'created_by', 'updated_by',
|
|
];
|
|
|
|
public function fromUnit()
|
|
{
|
|
return $this->belongsTo(ReferenceUnit::class, 'from_unit_code', 'code');
|
|
}
|
|
|
|
public function toUnit()
|
|
{
|
|
return $this->belongsTo(ReferenceUnit::class, 'to_unit_code', 'code');
|
|
}
|
|
}
|