45 lines
844 B
PHP
45 lines
844 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ConsistencyRatio extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'kriteria_id',
|
|
'waktu_makan_id',
|
|
'komponen_id',
|
|
'user_id',
|
|
'nilai_cr',
|
|
'tanggal_perhitungan'
|
|
];
|
|
|
|
protected $casts = [
|
|
'tanggal_perhitungan' => 'datetime',
|
|
'nilai_cr' => 'float'
|
|
];
|
|
|
|
public function kriteria()
|
|
{
|
|
return $this->belongsTo(Kriteria::class);
|
|
}
|
|
|
|
public function waktuMakan()
|
|
{
|
|
return $this->belongsTo(WaktuMakan::class);
|
|
}
|
|
|
|
public function komponen()
|
|
{
|
|
return $this->belongsTo(Komponen::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|