<?php

namespace App\Models;

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

class Bagian extends Model
{
    use HasFactory;

    protected $table = 'bagian';

    protected $fillable = ['nama_bagian'];

    // Relasi ke tabel users
    public function users()
    {
        return $this->hasMany(User::class, 'bagian_id');
    }

    // Relasi ke tabel audit
    public function audits()
    {
        return $this->hasMany(Audit::class, 'bagian_id');
    }
}
