<?php

namespace App\Models;

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

class Guru extends Model
{
    use HasFactory;

    protected $table = 'guru';
    protected $primaryKey = 'nip';
    public $incrementing = false;
    protected $keyType = 'int';
    public $timestamps = false;

    protected $fillable = [
        'nip',
        'id_profil',
        'nama_guru',
        'mapel',
        'jabatan',
        'foto'
    ];

    /**
     * Get the department profile associated with the teacher.
     */
    public function profil()
    {
        return $this->belongsTo(ProfilJurusan::class, 'id_profil', 'id_profil');
    }
}
