<?php

namespace App\Models;

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

class Sp extends Model
{
    use HasFactory;
    protected $table = 'sps';
    protected $primaryKey = 'id_sp';

    protected $fillable = [
        'id_siswa',
        'hari',
        'tanggal',
        'waktu',
        'jenis_sp',
        'permasalahan',
        'nomor_surat'
    ];
    public function siswa(): BelongsTo
    {
        return $this->belongsTo(Siswa::class, 'id_siswa', 'id_siswa');
    }
}
