'datetime', 'password' => 'hashed', 'date_of_birth' => 'date', 'join_date' => 'date', 'is_active' => 'boolean', ]; // ========================================================================= // RELASI ANTAR TABEL (MASTER DATA) // ========================================================================= // Relasi ke tabel departments public function department() { return $this->belongsTo(Department::class, 'department_id'); } // Relasi ke tabel positions public function position() { return $this->belongsTo(Position::class, 'position_id'); } public function trainings() { // Ubah 'user_id' menjadi 'employee_id' agar sesuai dengan database Anda saat ini return $this->belongsToMany(Subject::class, 'employee_subject', 'employee_id', 'subject_id') ->withPivot('status') ->withTimestamps(); } }