41 lines
760 B
PHP
41 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SimulasiAhp extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'simulasi_ahp';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'judul',
|
|
'pilihan_makanan_ids',
|
|
'hasil_rangking'
|
|
];
|
|
|
|
protected $casts = [
|
|
'pilihan_makanan_ids' => 'array',
|
|
'hasil_rangking' => 'array',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function pairwise()
|
|
{
|
|
return $this->hasMany(SimulasiAhpPairwise::class);
|
|
}
|
|
|
|
public function normalisasi()
|
|
{
|
|
return $this->hasMany(SimulasiAhpNormalisasi::class);
|
|
}
|
|
}
|