<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Guru extends Authenticatable
{
    use HasFactory;

    protected $table = 'gurus';
    protected $primaryKey = 'id_guru';
    public $incrementing = true;
    protected $keyType = 'int';

    protected $fillable = [
        'nip',
        'nama',
        'password',
        'foto_profil'
    ];

    protected $hidden = [
        'password',
    ];

    // Relasi ke Mengajar
    public function mengajars()
    {
        return $this->hasMany(Mengajar::class, 'id_guru', 'id_guru');
    }
}
