<?php

namespace App\Models;

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

class P3SuratPenelitian extends Model
{
    use HasFactory;

    protected $table = 'p3_surat_penelitian';
    protected $primaryKey = 'nosrt';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $fillable = [
        'nosrt',
        'tanggal',
        'nim_mahasiswa',
        'judul',
        'kepada'
    ];

    protected $casts = [
        'tanggal' => 'date'
    ];


    public function mahasiswa()
    {
        return $this->belongsTo(Mahasiswa::class, 'nim_mahasiswa', 'nim');
    }
}
