Photographic evidence is a critical part of every vehicle appraisal. After completing the mechanical and inspection steps, evaluators upload images that document the physical condition of the vehicle from multiple angles. These images are stored on the server, linked to the vehicle record, and automatically embedded in the generated PDF report — creating a complete, tamper-evident appraisal package.Documentation 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.
The VehiculoImagen Model
Each image is stored as a row in the vehiculo_imagen table, managed by the VehiculoImagen Eloquent model. The model uses soft deletes, so removed images are retained in the database for audit purposes.
| Field | Type | Description |
|---|---|---|
id_vehiculo | integer (FK) | Links the image to a specific vehicle appraisal |
lado | string | Position or angle label for the photo |
url | string | Storage-relative path used to retrieve the file |
descripcion | string | null | Optional notes about what the image shows |
fecha | date | Date the image was uploaded |
Routes
All image routes are grouped under the/registro prefix and require authentication (auth, verified middleware).
| Method | URI | Name | Controller Method | Purpose |
|---|---|---|---|---|
GET | /registro/imagenes/vehiculo/{id} | imagenes.vehiculo | ImagenesController@index | Show the image upload page for a vehicle |
POST | /registro/imagenes/vehiculo/store/{id} | imagenes.vehiculo.store | ImagenesController@store | Upload and persist new images |
GET | /registro/imagenes/vehiculo/edit/{id} | imagenes.vehiculo.edit | ImagenesController@edit | Show the image editing page |
POST | /registro/imagenes/vehiculo/update/{id} | imagenes.vehiculo.update | ImagenesController@update | Update, add, or remove images |
Upload page — GET /registro/imagenes/vehiculo/{id}
The controller checks that the authenticated user is authorized to view the vehicle via its policy. If no images exist yet for the vehicle, the upload view (Registro/create/imagenes_avaluo) is rendered. If images already exist, the user is redirected to the dashboard to prevent accidental duplication.
Store images — POST /registro/imagenes/vehiculo/store/{id}
Validated images are iterated, saved to the public storage disk under vehiculos/, and bulk-inserted into vehiculo_imagen. Each file is given a deterministic, collision-safe name. The lado column is populated from the ubicacion field submitted by the form:
resultados.avaluo).
Edit & update — GET /registro/imagenes/vehiculo/edit/{id} and POST /registro/imagenes/vehiculo/update/{id}
The edit flow loads all existing images for the vehicle and renders Registro/update/EditImagenes. The update handler reconciles the submitted image list against the database:
- Retained images (sent with an
id) — onlyladoanddescripcionare updated; the file on disk is unchanged. - New images (sent with a
file) — saved to storage and inserted as new rows. - Removed images (exist in the database but absent from the request) — the physical file is deleted from storage and the row is soft-deleted.
Storage
Images are written to thepublic storage disk, which maps to storage/app/public/ on the server filesystem. The subfolder used is vehiculos/:
When running Avalúo Vehicular with Docker, the
storage/app/public directory is mounted as a named Docker volume. This ensures uploaded images survive container restarts and re-deployments without data loss. Make sure the volume is backed up as part of your disaster-recovery plan.Images in Reports
When a PDF report is generated for an appraisal, all images associated with the vehicle are fetched and embedded directly into the document:resources/views/pdf/avaluo.blade.php iterates over $imagenes and renders each one inline, giving recipients a self-contained PDF that does not depend on a live server to display the photos.