Overview
TheUsuario model extends Laravel’s Authenticatable class and represents authenticated users in the DentControl system. This includes dentists, assistants, and superadmins who manage clinic operations.
Table Schema
Database table name
Primary key column (auto-incrementing)
Includes
created_at and updated_at columnsFields
Clinic Association
Foreign key to the clinic this user belongs to
Personal Information
First name
Paternal surname
Maternal surname (optional)
Professional Information
Professional license number. Unique and nullable.
Authentication
Username for login. Must be unique.
Hashed password. Automatically hashed by Laravel.
Authorization
User role:
superadmin, dentista, or asistenteStatus
User status:
activo or bajaHidden Fields
The following fields are automatically hidden from JSON responses:passwordremember_token
Casts
Automatically hashed when saved to database
Relationships
clinica
Type:belongsTo
A user belongs to one clinic.
id_clinica
citas
Type:hasMany
A user (dentist) has many appointments.
id_usuario on citas table
notasEvolucion
Type:hasMany
A user can create many progress notes.
id_usuario on notas_evolucion table
Example Usage
Creating a New User
Authentication
Retrieving User with Relationships
Filtering by Role
Authentication Methods
The model overrides default authentication methods:Model Definition
Location:app/Models/Usuario.php