<?php

namespace App\Models;

use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;

class Pengguna extends Authenticatable
{
    use HasApiTokens, Notifiable, HasFactory;

    protected $table = 'pengguna';
    protected $fillable = ['nama', 'email', 'kata_sandi'];
    protected $hidden = ['kata_sandi',];

    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    public function anak()
    {
        return $this->hasMany(Anak::class);
    }
    public function getAuthPassword()
    {
        return $this->kata_sandi;
    }
}
