<?php

namespace App\Models;

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

class PindahSekolah extends Model
{
    use HasFactory;

    protected $table = 'pindah_sekolahs';

    protected $primaryKey = 'id_pindah_sekolah';

    protected $fillable = [
        'id_siswa',
        'tanggal',
        'hari',
        'keterangan',
        'tujuan',
        'nomor_surat',
    ];

    public function siswa(): BelongsTo
    {
        return $this->belongsTo(Siswa::class, 'id_siswa', 'id_siswa');
    }
}
