Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/lerichardv/patolab-platform/llms.txt

Use this file to discover all available pages before exploring further.

PatoLab reads all runtime configuration from a .env file located in the root of your project. A fully commented template is shipped as .env.example — copy it to .env before running the application for the first time and fill in the values that differ from the defaults. Variables marked required have no sensible default and must be set explicitly; leaving them blank will cause the application to fail to boot or behave incorrectly.
cp .env.example .env
php artisan key:generate

Application

APP_NAME
string
default:"Laravel"
The human-readable name of your PatoLab installation. Displayed in the browser title, email subjects, and anywhere config('app.name') is referenced.
APP_ENV
string
default:"local"
Deployment environment. Accepted values: local, staging, production. Laravel uses this value to decide which service providers and exception-handling behaviours to activate.
APP_KEY
string
required
A 32-character base64 encryption key used to sign cookies, encrypt sessions, and protect queue payloads. Always generate a fresh key for every installation.
php artisan key:generate
APP_DEBUG
boolean
default:"true"
When true, full stack traces and variable dumps are rendered in the browser on unhandled exceptions. Must be set to false in any public-facing environment.
Running with APP_DEBUG=true in production exposes internal stack traces, file paths, environment variable values, and SQL queries to anyone who triggers an error. Always set APP_DEBUG=false before deploying to a public server.
APP_URL
string
default:"http://localhost"
The canonical URL of your PatoLab instance, including the protocol (https://). Used when generating links in emails, PDF headers, and the Inertia SSR response.
APP_URL=https://lab.myhospital.hn
APP_LOCALE
string
default:"en"
Default locale for translations and date/number formatting. Set to es for Spanish-speaking deployments.
APP_FALLBACK_LOCALE
string
default:"en"
Fallback locale used when a translation key is missing in APP_LOCALE.

Database

PatoLab supports SQLite, MySQL, and PostgreSQL out of the box. The default configuration targets SQLite, which requires zero setup and works perfectly for development and small deployments.
SQLite is the default (DB_CONNECTION=sqlite) and is stored at database/database.sqlite. There is no daemon to start, no credentials to configure, and it is fast enough for most single-lab deployments. Switch to MySQL or PostgreSQL only when you need replication, row-level security, or plan to run a multi-server setup.
DB_CONNECTION
string
default:"sqlite"
Database driver. Accepted values: sqlite, mysql, pgsql.
DB_HOST
string
default:"127.0.0.1"
Hostname or IP of the database server. Not used for SQLite.
DB_PORT
integer
default:"3306"
TCP port of the database server. Common defaults: 3306 (MySQL), 5432 (PostgreSQL). Not used for SQLite.
DB_DATABASE
string
Database name (MySQL/PostgreSQL) or absolute path to the .sqlite file. When left blank with DB_CONNECTION=sqlite, Laravel resolves to database/database.sqlite automatically.
DB_USERNAME
string
Database user. Not used for SQLite.
DB_PASSWORD
string
Database password. Not used for SQLite.

Queue & Session

QUEUE_CONNECTION
string
default:"database"
The queue driver. PatoLab relies on the queue for PDF generation and notification dispatch. The default database driver stores jobs in the jobs table — no Redis or Beanstalkd required.Start a worker with:
php artisan queue:listen
SESSION_DRIVER
string
default:"database"
Where to persist sessions. The default database driver is recommended for production. Avoid the file driver on load-balanced setups.
SESSION_LIFETIME
integer
default:"120"
Number of minutes before an idle session expires. Increase this value for labs where pathologists tend to keep long-running browser sessions.
SESSION_ENCRYPT
boolean
default:"false"
When true, session data is encrypted at rest using APP_KEY. Recommended for HIPAA-adjacent deployments.

Mail

MAIL_MAILER
string
default:"log"
Transport driver. log writes emails to the Laravel log (useful for development). Switch to smtp, ses, or mailgun in production.
MAIL_HOST
string
default:"127.0.0.1"
SMTP server hostname.
MAIL_PORT
integer
default:"2525"
SMTP port. Common values: 587 (STARTTLS), 465 (SSL), 25 (plain).
MAIL_USERNAME
string
SMTP username credential.
MAIL_PASSWORD
string
SMTP password credential.
MAIL_FROM_ADDRESS
string
default:"hello@example.com"
The From: address for all outbound mail. Set to a real mailbox monitored by your lab team.
MAIL_FROM_NAME
string
default:"${APP_NAME}"
The From: display name. Defaults to the value of APP_NAME.

WhatsApp

PatoLab can deliver specimen notifications and report delivery confirmations via the WhatsApp Business Cloud API. All five variables below must be configured together; leaving any blank disables WhatsApp messaging silently.
WHATSAPP_TOKEN
string
Permanent or temporary access token issued by the Meta developer portal.
WHATSAPP_PHONE_NUMBER_ID
string
The numeric Phone Number ID from your WhatsApp Business Account dashboard. This is not the actual phone number — it is the internal identifier Meta assigns to the registered number.
WHATSAPP_BUSINEESS_ACCOUNT_ID
string
Your WhatsApp Business Account (WABA) ID. Note: the variable name contains a typo in the upstream source (BUSINEESS) — reproduce it exactly as shown.
WHATSAPP_VERSION
string
default:"v23.0"
Meta Graph API version to use for outbound requests. Update this when Meta deprecates an older version.
WHATSAPP_VERIFY_TOKEN
string
A secret string you define, used during the webhook verification handshake when registering your callback URL in the Meta developer portal.

PDF / Browsershot

PatoLab generates specimen reports as PDF files using Spatie Browsershot, which launches a headless Chromium process. All four paths must be valid executables on the server.
BROWSERSHOT_INCLUDE_PATH
string
default:"$PATH:/usr/local/bin:/usr/bin"
Shell PATH extension injected before invoking Node/Chromium. Ensures system binaries are discoverable in restricted environments such as www-data or container runtimes.
BROWSERSHOT_INCLUDE_PATH='$PATH:/usr/local/bin:/usr/bin'
BROWSERSHOT_NODE_BINARY
string
default:"/usr/local/bin/node"
Absolute path to the node executable. Verify with which node.
BROWSERSHOT_NPM_BINARY
string
default:"/usr/local/bin/npm"
Absolute path to the npm executable. Required by Browsershot for resolving the Puppeteer package location.
BROWSERSHOT_CHROME_PATH
string
default:"/usr/bin/google-chrome-stable"
Absolute path to the Chromium or Google Chrome executable. On Debian/Ubuntu you can install it with:
apt-get install -y google-chrome-stable
On systems where the binary lives elsewhere (e.g., /usr/bin/chromium-browser), update this variable accordingly.

Collaboration Server

PatoLab includes a real-time collaborative report editor powered by Hocuspocus v4 (WebSocket) + Yjs + TipTap. The collaboration server runs as a separate Node.js process in editor-collaboration-server/.
# Start the collaboration server (from the editor-collaboration-server/ directory)
npm install
npm run dev
VITE_COLLABORATION_SERVER_URL
string
default:"http://127.0.0.1:1234"
WebSocket URL the React frontend connects to for real-time document collaboration. This variable is prefixed with VITE_ so it is embedded into the frontend bundle at build time — changing it after a build requires a rebuild.
# Production example
VITE_COLLABORATION_SERVER_URL=wss://collab.myhospital.hn

Logging

LOG_CHANNEL
string
default:"stack"
Logging channel configuration. The stack channel aggregates multiple drivers defined in config/logging.php.
LOG_LEVEL
string
default:"debug"
Minimum log severity to record. Accepted values follow PSR-3: debug, info, notice, warning, error, critical, alert, emergency. Set to warning or error in production to reduce log volume.

Quick-start checklist

After copying .env.example to .env, work through this checklist before your first php artisan migrate:
APP_NAME="PatoLab"
APP_ENV=production
APP_KEY=           # fill with: php artisan key:generate
APP_DEBUG=false
APP_URL=https://your-domain.hn
APP_LOCALE=es

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=patolab
DB_USERNAME=patolab_user
DB_PASSWORD=strong_password_here

QUEUE_CONNECTION=database
SESSION_DRIVER=database

WHATSAPP_TOKEN=
WHATSAPP_PHONE_NUMBER_ID=
WHATSAPP_BUSINEESS_ACCOUNT_ID=
WHATSAPP_VERSION=v23.0
WHATSAPP_VERIFY_TOKEN=

BROWSERSHOT_NODE_BINARY=/usr/local/bin/node
BROWSERSHOT_NPM_BINARY=/usr/local/bin/npm
BROWSERSHOT_CHROME_PATH=/usr/bin/google-chrome-stable

VITE_COLLABORATION_SERVER_URL=wss://collab.your-domain.hn

Build docs developers (and LLMs) love