<?php

namespace App\Models;

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

class Absensi extends Model
{
    /**
     * ================================
     * MASS ASSIGNMENT (FILLABLE)
     * ================================
     */
    protected $fillable = [
        'siswa_id',
        'guru_id',
        'kategori',
        'tanggal',
        'jam_scan',
        'status'
    ];

    /**
     * ================================
     * RELASI KE SISWA
     * ================================
     */
    public function siswa(): BelongsTo
    {
        return $this->belongsTo(Siswa::class);
    }

    /**
     * ================================
     * RELASI KE GURU
     * ================================
     */
    public function guru(): BelongsTo
    {
        return $this->belongsTo(Guru::class);
    }
}
