Avalúo Vehicular uses SQLite as its sole database engine in both development and production. There is no MySQL, PostgreSQL, or external database server to provision — the entire schema lives in a single file atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alber1802/AvaluoVehicular/llms.txt
Use this file to discover all available pages before exploring further.
database/database.sqlite. This design keeps the infrastructure footprint minimal: one SQLite file handles application data, sessions, cache, and background job queues simultaneously. In the Docker production environment the file is mounted as a persistent volume so it survives container restarts and re-deployments.
Setup
Create the SQLite file
Laravel requires the database file to exist before it can run migrations. Create it with:On Windows (PowerShell) use:
Configure the database connection
Open your
.env file and ensure the following variables are set. When DB_DATABASE is omitted, Laravel automatically resolves the path to database/database.sqlite relative to the project root:Migration Reference
Migrations run in the order shown below. Each file is idempotent — runningphp artisan migrate on an already-migrated database is safe.
Core Laravel Tables
| Migration File | Tables Created | Purpose |
|---|---|---|
0001_01_01_000000_create_users_table.php | users, password_reset_tokens, sessions | Authentication foundation: user accounts with email verification, password reset tokens, and database-backed sessions |
0001_01_01_000001_create_cache_table.php | cache, cache_locks | Database-backed cache store used when CACHE_STORE=database |
0001_01_01_000002_create_jobs_table.php | jobs, job_batches, failed_jobs | Database-backed queue driver used when QUEUE_CONNECTION=database |
Vehicle Domain Tables
| Migration File | Table | Purpose |
|---|---|---|
2024_01_01_000001_create_marca_vehiculo_table.php | marca_vehiculo | Vehicle brands/makes, each storing the depreciation rate (tasa_k) and residual value used in appraisal calculations, linked to the creating user |
2024_01_01_000002_create_vehiculos_table.php | vehiculos | Core vehicle records: entity, evaluation date, location, type, fuel, brand, model, year, plate, engine serial, chassis, colour, origin, mileage, and reference price; soft-deleted |
2024_01_01_000003_create_avaluo_table.php | avaluo | The appraisal result for each vehicle: replacement factor, final estimation, currency, and the three depreciation percentages (model, mileage, inspection); soft-deleted |
2024_01_01_000004_create_condicion_general_table.php | condicion_general | General condition assessment per vehicle: operational state, overall state, and observations; soft-deleted |
2024_01_01_000005_create_sistemas_table.php | sistemas | Vehicle system components (engine, transmission, etc.) with per-component JSON state, valuation, and observations; soft-deleted |
2024_01_01_000007_create_inspeccion_table.php | inspeccion | Individual inspection line items per vehicle: feature name, characteristic, presence flag, valuation weight, and observations; soft-deleted |
2024_01_01_000011_create_archivos_table.php | archivos | Attached documents per vehicle (PDFs, spreadsheets, etc.) with file type, URL, comment, and date; soft-deleted |
2024_01_01_000012_create_vehiculo_imagen_table.php | vehiculo_imagen | Vehicle photographs keyed by side (front, rear, left, right), with URL, description, and date; soft-deleted |
Feature & Permission Tables
| Migration File | Table | Purpose |
|---|---|---|
2025_08_26_100418_add_two_factor_columns_to_users_table.php | users (altered) | Adds two_factor_secret, two_factor_recovery_codes, and two_factor_confirmed_at columns to support Laravel Fortify 2FA |
2026_01_02_115331_create_avaluo_compartidos_table.php | avaluo_compartido | Shared appraisal links: token, validity window (fecha_inicio/fecha_fin), status (activo, vencido, renovado), view counter, and reason for sharing; soft-deleted |
2026_01_14_103816_create_permission_tables.php | permissions, roles, model_has_permissions, model_has_roles, role_has_permissions | Spatie Laravel Permission tables for role-based access control (RBAC) |
Inspection Section Templates
These tables store reusable section definitions that are loaded when initialising a new appraisal:| Migration File | Table | Purpose |
|---|---|---|
2026_03_23_135348_create_seccion_fallas_table.php | seccion_fallas | Template fault-section entries: component title, component name, and depreciation valuation weight |
2026_03_23_135348_create_seccion_tecnicas_table.php | seccion_tecnicas | Template technical-section entries: component with a JSON opciones array mapping rating labels (e.g. “Bueno”, “Requiere cambio”) to numeric values |
2026_03_23_135349_create_accesorios_table.php | accesorios | Per-vehicle accessory records with applicability flag, condition state (bueno, aceptable, dañado), and observations; soft-deleted |
2026_03_23_135349_create_seccion_accesorios_table.php | seccion_accesorios | Template accessory-section entries: component name and default state; state field later changed to JSON by a follow-up migration |
2026_06_21_192538_change_estado_to_json_in_seccion_accesorios_table.php | seccion_accesorios (altered) | Changes the estado column from string to json, allowing multiple state values to be stored per accessory template entry |
Artisan Database Commands
Docker Persistence
In the Docker production environment, the SQLite file is exposed outside the container via a bind mount or named volume so that data is not lost when the container is rebuilt or restarted. A typicaldocker-compose.yml fragment looks like:
/var/www/html/database/database.sqlite must match the DB_DATABASE value in .env.docker. Create an empty file on the host before the first docker compose up: