MIF_E31221259/app/Models/Diagnosa.php

54 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\User;
use App\Models\Kecerdasan;
class Diagnosa extends Model
{
use HasFactory;
/**
* The table associated with the model.
* By default Laravel expects 'diagnosas', so we override here.
*
* @var string
*/
protected $table = 'diagnosa';
/**
* The attributes that are mass assignable.
*
* @var array<int,string>
*/
protected $fillable = [
'user_id',
'kecerdasan_id',
'presentase',
'catatan',
];
/**
* Get the user that owns the diagnosa.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id', 'id');
}
/**
* Get the jurusan associated with the diagnosa.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function kecerdasan()
{
return $this->belongsTo(Kecerdasan::class, 'kecerdasan_id');
}
}