<?php

namespace App\Models;

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

use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class Kelas extends Model
{
    use HasApiTokens, HasFactory, Notifiable;

    protected $fillable = [
        'nama_kelas', 'wali_kelas_id'
    ];

    public function waliKelas()
    {
        return $this->belongsTo(\App\Models\Guru::class, 'wali_kelas_id');
    }

    public function prestasis()
    {
        return $this->hasMany(Prestasi::class);
    }
}
