<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Teacher extends Model
{
    protected $fillable = [
        'user_id',
        'name',
        'nip',
        'photo',
        'department_id'
    ];

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

   // app/Models/Teacher.php
public function modules()
{
    return $this->hasMany(Module::class, 'homeroom_teacher_id');
}

}

