Schema Overview
Dashboard Laravel uses a relational database structure with the following core tables:- users - Authentication and user management
- clientes - Customer/client records
- ventas - Sales transactions
- facturas - Invoice management
- mensajes - Client messaging system
- estadisticas - Analytics and statistics
- homes - Homepage content
- nosotros - About us information
Table Definitions
users
Manages authenticated users of the dashboard system.Primary key, auto-incrementing
User’s full name
User’s email address (unique)
Email verification timestamp (nullable)
Hashed password
Token for “remember me” functionality
Record creation timestamp
Record last update timestamp
- UNIQUE on
email
clientes
Stores customer/client information with segmentation.Primary key, auto-incrementing
Client’s first name
Client’s last name
Client’s email address (unique)
Phone number (nullable)
Client status:
activo, inactivo (default: activo)Client segment:
premium, regular, ocasional (default: regular)Total number of purchases (default: 0)
Record creation timestamp
Record last update timestamp
- UNIQUE on
email
- Has many
ventas - Has many
facturas - Has many
mensajes
ventas
Records sales transactions linked to clients.Primary key, auto-incrementing
Unique order number
Foreign key to clientes table
Product name or description
Total sale amount
Sale status:
completado, pendiente, en_camino, devuelto (default: pendiente)Record creation timestamp
Record last update timestamp
- UNIQUE on
numero_orden - FOREIGN KEY on
cliente_idreferencesclientes(id)ON DELETE CASCADE
- Belongs to
cliente - Has one
factura
facturas
Manages invoices for clients and sales.Primary key, auto-incrementing
Unique invoice number
Foreign key to clientes table
Foreign key to ventas table (nullable)
Invoice concept or description
Invoice amount
Issue date
Due date
Invoice status:
pagada, pendiente, vencida (default: pendiente)Record creation timestamp
Record last update timestamp
- UNIQUE on
numero_factura - FOREIGN KEY on
cliente_idreferencesclientes(id)ON DELETE CASCADE - FOREIGN KEY on
venta_idreferencesventas(id)ON DELETE SET NULL
- Belongs to
cliente - Belongs to
venta
mensajes
Manages messages between the system and clients.Primary key, auto-incrementing
Foreign key to clientes table
Message content
Message type:
enviado, recibido (default: recibido)Read status (default: false)
Record creation timestamp
Record last update timestamp
- FOREIGN KEY on
cliente_idreferencesclientes(id)ON DELETE CASCADE
- Belongs to
cliente
estadisticas
Stores sales statistics and analytics data.Primary key, auto-incrementing
Product name
Quantity sold
Unit price
Statistics date
Total sales amount
Profit margin
Product category (default:
general)Status (default:
activo)Record creation timestamp
Record last update timestamp
homes
Manages homepage content and configuration.Primary key, auto-incrementing
Record creation timestamp
Record last update timestamp
nosotros
Stores “About Us” page content.Primary key, auto-incrementing
Record creation timestamp
Record last update timestamp
