How silvioramirez/laboratorio works
Purpose and Runtime
This is a Laravel 10 server-rendered laboratory-management system. It manages patients, laboratory staff, exams, sample collection, result entry/reporting, and a processing queue, with role/permission-based access. PHP/Laravel runs behind Apache/XAMPP; the HTTP entry point is public/index.php, bootstrap is bootstrap/app.php, and CLI/scheduled commands enter through artisan and app/Console/Kernel.php.
HTTP Application Boundary
Browser requests are defined primarily in routes/web.php and handled by resource-oriented controllers in app/Http/Controllers/. Laravel’s middleware pipeline is configured in app/Http/Kernel.php, applying authentication, session/CSRF handling, and custom security headers via app/Http/Middleware/NeutronHeaders.php. routes/api.php exists as a separate API boundary, although the tree indicates the main UI is Blade-rendered.
Identity, Roles, and Authorization
Laravel UI authentication controllers provide login, registration, password reset, and verification under app/Http/Controllers/Auth/. Application access is governed by Spatie permissions (config/permission.php) plus domain policies such as app/Policies/ResultadosPolicy.php, app/Policies/ColaPolicy.php, and app/Policies/PacientePolicy.php. Roles and user administration are handled through app/Http/Controllers/RoleController.php and app/Http/Controllers/UserController.php.
Laboratory Domain and Persistence
Eloquent models are the core domain/persistence boundary: patients, bioanalysts, exams, samples, characteristics, configurations, queue items, and result records live in app/Models/. Result data has a header/detail structure and queue association: app/Models/Resultados.php, app/Models/ResultadosDetalle.php, and app/Models/ColaResultados.php. Relational schema ownership is expressed in migrations including database/migrations/2023_08_09_193327_create_examens_table.php, database/migrations/2023_08_11_160834_create_resultados_detalles_table.php, and database/migrations/2023_08_28_223531_create_colas_table.php.
Operational Workflow
Typical flow is: authorized staff maintain patient/exam/sample reference data; a sample or request enters the queue; bioanalysts record results and result details; queue/result relations track work completion. Controllers divide these stages across app/Http/Controllers/PacienteController.php, app/Http/Controllers/MuestraController.php, app/Http/Controllers/ColaController.php, and app/Http/Controllers/ResultadosController.php. Input validation is an explicit boundary through dedicated form requests such as app/Http/Requests/StoreResultadosRequest.php and app/Http/Requests/StoreColaRequest.php.
Presentation, Tables, and Documents
Controllers render Blade views using the shared authenticated layout at resources/views/layouts/app.blade.php. CRUD pages are organized by domain, while result output supports screen, print, and PDF variants in resources/views/resultados/print.blade.php, resources/views/resultados/pdf.blade.php, and resources/views/resultados/pdf-cola.blade.php. Server-side tabular listings use Yajra DataTables classes such as app/DataTables/ResultadosDataTable.php and app/DataTables/PacientesDataTable.php; DomPDF is configured in config/dompdf.php.
Infrastructure and External Packages
Persistence, cache, sessions, queues, mail, filesystem, and logging are Laravel-configured boundaries under config/database.php, config/queue.php, and config/filesystems.php. The frontend asset pipeline uses Vite (vite.config.js) with Bootstrap/Popper and FontAwesome. Key integrations are Spatie Laravel Permission, Yajra DataTables, Maatwebsite Excel, and DomPDF. Local HTTPS/XAMPP deployment material is provided in ctr/ and the root .htaccess/public/.htaccess supports Apache routing.
Main entry points: ResultadosController.php Laboratory Workflow Controllers · app.php Application Bootstrap · Resultados.php Result Header & Details · Kernel.php Middleware Pipeline
Components 20
Runtime Entry
- Apache / XAMPP · Routes local HTTPS requests to Laravel public entry.
public/.htaccess - Web Entry
public/index.php - Application Bootstrap
bootstrap/app.php - CLI & Scheduler
app/Console/Kernel.php
HTTP Application
- Web & API Routes · Blade UI is primarily served through web routes.
routes/web.php - Middleware Pipeline · Applies sessions, CSRF, authentication, and security headers.
app/Http/Kernel.php - Authentication · Login, registration, reset, and verification flows.
- Roles & Policies · Spatie permissions and domain policies govern staff access.
config/permission.php - Laboratory Workflow Controllers · Patients, samples, queue, and result actions.
app/Http/Controllers/ResultadosController.php - Form Requests
app/Http/Requests/StoreResultadosRequest.php
Laboratory Domain
- Eloquent Laboratory Models · Patients, exams, samples, staff, characteristics, configurations, queues, and results.
- Result Header & Details · Result records include details and queue association.
app/Models/Resultados.php - Processing Queue · Tracks sample/request work through completion.
app/Models/ColaResultados.php - Relational Schema
database/migrations/2023_08_28_223531_create_colas_table.php
Presentation & Output
- Authenticated Blade UI · Shared application layout and domain CRUD pages.
resources/views/layouts/app.blade.php - Server-side Tables
- Print & PDF Reports · Renders result reports for screen printing and PDF output.
resources/views/resultados/pdf.blade.php
Platform Services
- Database
config/database.php - Configured Laravel Services
config/queue.php - Frontend Asset Build · Builds Bootstrap, Popper, and FontAwesome assets.
vite.config.js
Connections 23
- Apache / XAMPP → Web Entry: forwards requests
- Web Entry → Application Bootstrap: boots
- Application Bootstrap → Web & API Routes: loads application
- CLI & Scheduler → Application Bootstrap: boots via artisan
- Web & API Routes → Middleware Pipeline: passes requests through
- Middleware Pipeline → Authentication: enforces identity
- Middleware Pipeline → Laboratory Workflow Controllers: dispatches authorized requests
- Authentication → Roles & Policies: uses roles and permissions
- Laboratory Workflow Controllers → Roles & Policies: checks policies
- Laboratory Workflow Controllers → Form Requests: validates input
- Laboratory Workflow Controllers → Eloquent Laboratory Models: maintains reference data
- Laboratory Workflow Controllers → Processing Queue: creates and advances work
- Laboratory Workflow Controllers → Result Header & Details: records results
- Processing Queue → Result Header & Details: associates completion
- Result Header & Details → Eloquent Laboratory Models: uses result details
- Eloquent Laboratory Models → Database: persists through Eloquent
- Relational Schema → Database: defines tables
- Laboratory Workflow Controllers → Authenticated Blade UI: renders CRUD pages
- Laboratory Workflow Controllers → Server-side Tables: serves listings
- Result Header & Details → Print & PDF Reports: supplies report data
- Laboratory Workflow Controllers → Print & PDF Reports: renders print/PDF
- Frontend Asset Build → Authenticated Blade UI: builds UI assets
- Application Bootstrap → Configured Laravel Services: configures runtime services