Skip to main content

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.
id
bigint
required
Primary key, auto-incrementing
name
string
User’s full name
email
string
User’s email address (unique)
email_verified_at
timestamp
Email verification timestamp (nullable)
password
string
Hashed password
remember_token
string
Token for “remember me” functionality
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp
Indexes:
  • UNIQUE on email

clientes

Stores customer/client information with segmentation.
id
bigint
required
Primary key, auto-incrementing
nombre
string
Client’s first name
apellido
string
Client’s last name
email
string
Client’s email address (unique)
telefono
string
Phone number (nullable)
estado
enum
Client status: activo, inactivo (default: activo)
segmento
enum
Client segment: premium, regular, ocasional (default: regular)
total_compras
integer
Total number of purchases (default: 0)
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp
Indexes:
  • UNIQUE on email
Relationships:
  • Has many ventas
  • Has many facturas
  • Has many mensajes

ventas

Records sales transactions linked to clients.
id
bigint
required
Primary key, auto-incrementing
numero_orden
string
Unique order number
cliente_id
bigint
Foreign key to clientes table
producto
string
Product name or description
total
decimal(10,2)
Total sale amount
estado
enum
Sale status: completado, pendiente, en_camino, devuelto (default: pendiente)
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp
Indexes:
  • UNIQUE on numero_orden
  • FOREIGN KEY on cliente_id references clientes(id) ON DELETE CASCADE
Relationships:
  • Belongs to cliente
  • Has one factura

facturas

Manages invoices for clients and sales.
id
bigint
required
Primary key, auto-incrementing
numero_factura
string
Unique invoice number
cliente_id
bigint
Foreign key to clientes table
venta_id
bigint
Foreign key to ventas table (nullable)
concepto
string
Invoice concept or description
monto
decimal(10,2)
Invoice amount
fecha_emision
date
Issue date
fecha_vencimiento
date
Due date
estado
enum
Invoice status: pagada, pendiente, vencida (default: pendiente)
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp
Indexes:
  • UNIQUE on numero_factura
  • FOREIGN KEY on cliente_id references clientes(id) ON DELETE CASCADE
  • FOREIGN KEY on venta_id references ventas(id) ON DELETE SET NULL
Relationships:
  • Belongs to cliente
  • Belongs to venta

mensajes

Manages messages between the system and clients.
id
bigint
required
Primary key, auto-incrementing
cliente_id
bigint
Foreign key to clientes table
contenido
text
Message content
tipo
enum
Message type: enviado, recibido (default: recibido)
leido
boolean
Read status (default: false)
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp
Indexes:
  • FOREIGN KEY on cliente_id references clientes(id) ON DELETE CASCADE
Relationships:
  • Belongs to cliente

estadisticas

Stores sales statistics and analytics data.
id
bigint
required
Primary key, auto-incrementing
producto
string
Product name
cantidad
integer
Quantity sold
precio
decimal(10,2)
Unit price
fecha
date
Statistics date
total_ventas
decimal(12,2)
Total sales amount
margen
decimal(8,2)
Profit margin
categoria
string
Product category (default: general)
estado
string
Status (default: activo)
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp

homes

Manages homepage content and configuration.
id
bigint
required
Primary key, auto-incrementing
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp

nosotros

Stores “About Us” page content.
id
bigint
required
Primary key, auto-incrementing
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp

Entity Relationship Diagram

Migration Files Reference

All schema definitions are created through migration files located in:
database/migrations/
├── 0001_01_01_000000_create_users_table.php
├── 0001_01_01_000001_create_cache_table.php
├── 0001_01_01_000002_create_jobs_table.php
├── 2026_03_03_021430_create_homes_table.php
├── 2026_03_03_022050_create_estadisticas_table.php
├── 2026_03_03_191644_create_clientes_table.php
├── 2026_03_03_191659_create_ventas_table.php
├── 2026_03_03_191710_create_facturas_table.php
├── 2026_03_03_191720_create_mensajes_table.php
└── 2026_03_04_014709_create_nosotros_table.php

Build docs developers (and LLMs) love