<?php

namespace App\Models;

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

class Kelas extends Model
{
    use HasFactory;

    protected $table = 'kelas';
    protected $primaryKey = 'id_kelas';    

    // Gunakan salah satu antara fillable atau guarded
    protected $guarded = ['id_kelas'];

    public function mengajar()
    {
        return $this->hasMany(Mengajar::class, 'id_kelas', 'id_kelas');
    }
}
