<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Pegawai;

class UnitKerja extends Model
{
    use HasFactory;

    protected $table = 'unit_kerja'; // sesuaikan dengan nama tabel di migration

    protected $fillable = [
        'nama_unit'
    ];

    // 🔗 Relasi: 1 unit kerja punya banyak pegawai
    public function pegawai()
    {
        return $this->hasMany(Pegawai::class);
    }
}