<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Tymon\JWTAuth\Contracts\JWTSubject;

class AkunTeknisi extends Authenticatable implements JWTSubject
{
    use HasFactory, Notifiable;

    protected $table = 'akun_teknisis';
    protected $primaryKey = 'id_akun_teknisi';

    protected $fillable = [
        'id_teknisi',
        'username',
        'password',
        'status',
    ];

    protected $hidden = [
        'password',
    ];

    // Relasi ke tabel teknisi
    public function teknisi()
    {
        return $this->belongsTo(Teknisi::class, 'id_teknisi', 'id_teknisi');
    }

    // JWT Methods
    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    public function getJWTCustomClaims()
    {
        return [];
    }
}