<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class PenilaianDetail extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    public function penilaian()
    {
        return $this->belongsTo(Penilaian::class);
    }

    // Ubah nama fungsi jadi student, dan target Model jadi Student
    public function student()
    {
        return $this->belongsTo(Student::class, 'siswa_id'); // Pastikan foreign key tetap siswa_id
    }
}