<?php

namespace App\Models;

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

// {} Clase
class Usuario extends Authenticatable {

    use HasApiTokens, HasFactory, Notifiable;

    // protected $connection = 'sqlsrv';

    protected $table = 'usuarios';

    protected $primaryKey = 'id_usuario';

    public $rememberTokenName = 'serial_autenticacion';

    public $timestamps = false;

    protected $fillable = [
        'id_usuario',
        'nombre_usuario',
        'contrasena',
        'usuario',
        'correo',
        'id_sucursal',
        'id_entidad',
        'id_cajero',
        'id_oficial',
        'id_cobrador',
        'depurador',
        'contrasena_encriptada',
        'serial_autenticacion',
        'id_estado'
    ];

    protected $hidden = ['contrasena'];

    public function getAuthPassword() { return $this->contrasena; }

}
