<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Student;
use App\Models\User;

class Grade extends Model
{
    use HasFactory;

    protected $fillable = [
        'student_id',
        'user_id',
        'score'
    ];

    // 🔗 RELACIÓN: GRADE → STUDENT
    public function student()
    {
        return $this->belongsTo(Student::class);
    }

    // 🔗 RELACIÓN: GRADE → USER (DOCENTE)
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
