<?php

namespace App\Models;

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

class Mahasiswa extends Model
{
    use HasFactory;

    protected $table = 'mahasiswa';
    protected $primaryKey = 'nim';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $fillable = [
        'nim',
        'nama',
        'alamat',
        'bagian',
        'jurusan',
        'jenjang_program',
        'judul_skripsi'
    ];

    public function user()
    {
        return $this->belongsTo(User::class, 'nim', 'nim');
    }
}
