Skip to main content
MediPro uses a standard Laravel .env file to manage all environment configuration. This page documents every variable, how to get your local environment running, and how to run tests.

Prerequisites

Before starting, ensure you have the following installed:
RequirementMinimum version
PHP8.2+
Composer2.x
Node.js18+
npm9+

Quick setup

The composer setup script handles the full initial setup in one command:
composer setup
This script runs the following steps in sequence:
  1. composer install — installs PHP dependencies
  2. Copies .env.example to .env if no .env file exists
  3. php artisan key:generate — generates APP_KEY
  4. php artisan migrate --force — runs all database migrations
  5. npm install — installs Node dependencies
  6. npm run build — compiles front-end assets
Never run composer setup in production. It is intended for local development only. Production deployments require a separate, carefully controlled process — see the Deployment guide.

Running the development server

Once set up, start all development services with:
composer dev
This uses npx concurrently to run four processes simultaneously:
npx concurrently \
  -c "#93c5fd,#c4b5fd,#fb7185,#fdba74" \
  "php artisan serve" \
  "php artisan queue:listen --tries=1" \
  "php artisan pail --timeout=0" \
  "npm run dev" \
  --names=server,queue,logs,vite \
  --kill-others
Process nameCommandPurpose
serverphp artisan servePHP built-in web server on port 8000
queuephp artisan queue:listen --tries=1Processes queued jobs in real time
logsphp artisan pail --timeout=0Streams application logs to the terminal
vitenpm run devVite HMR dev server for CSS/JS assets
All four processes are colour-coded in the terminal output. If any one process exits, --kill-others shuts down the rest.

The .env file

Copy .env.example to .env and fill in values for your environment:
cp .env.example .env
php artisan key:generate
The full contents of .env.example are shown below for reference:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

# PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
# CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"

Environment variable reference

App

VariableDefaultDescription
APP_NAMELaravelApplication name. Used in UI and email templates via APP_NAME.
APP_ENVlocalCurrent environment. Use local, staging, or production.
APP_KEY(empty)32-character encryption key. Must be generated before first run.
APP_DEBUGtrueShows detailed error pages when true. Set to false in production.
APP_URLhttp://localhostCanonical base URL. Used for generating absolute links.
APP_LOCALEenDefault locale for translations.
APP_FALLBACK_LOCALEenLocale to fall back to if a translation key is missing.
APP_FAKER_LOCALEen_USLocale used by Faker when generating fake data in tests and seeders.
APP_MAINTENANCE_DRIVERfileHow maintenance mode state is stored. file or database.
BCRYPT_ROUNDS12Cost factor for password hashing. Lower values speed up tests.
Always run php artisan key:generate after copying .env.example. Laravel will refuse to serve requests if APP_KEY is empty.

Logging

VariableDefaultDescription
LOG_CHANNELstackDefault log channel. stack aggregates multiple channels.
LOG_STACKsingleChannels included in the stack channel.
LOG_DEPRECATIONS_CHANNELnullChannel for PHP/framework deprecation notices.
LOG_LEVELdebugMinimum severity to log. Options: debug, info, warning, error, critical.

Database

VariableDefaultDescription
DB_CONNECTIONsqliteDatabase driver. Options: sqlite, mysql, pgsql.
DB_HOST127.0.0.1Database server hostname (MySQL/PostgreSQL only).
DB_PORT3306Database server port (MySQL/PostgreSQL only).
DB_DATABASElaravelDatabase name (or SQLite file path).
DB_USERNAMErootDatabase username (MySQL/PostgreSQL only).
DB_PASSWORD(empty)Database password (MySQL/PostgreSQL only).
For local development, leave DB_CONNECTION=sqlite. Laravel will automatically use database/database.sqlite, which requires no database server. Run touch database/database.sqlite if the file does not exist yet.

Session

VariableDefaultDescription
SESSION_DRIVERdatabaseWhere sessions are stored. Options: database, file, cookie, redis.
SESSION_LIFETIME120Minutes before an idle session expires.
SESSION_ENCRYPTfalseEncrypt session payload at rest when true.
SESSION_PATH/Cookie path scope.
SESSION_DOMAINnullCookie domain scope. null uses the current domain.

Broadcasting, filesystem, and queue

VariableDefaultDescription
BROADCAST_CONNECTIONlogBroadcast driver. log writes events to the log instead of broadcasting.
FILESYSTEM_DISKlocalDefault storage disk.
QUEUE_CONNECTIONdatabaseQueue driver. database uses the jobs table.

Cache

VariableDefaultDescription
CACHE_STOREdatabaseCache backend. Options: database, file, redis, array.
CACHE_PREFIX(empty)Optional string prepended to all cache keys to avoid collisions.
MEMCACHED_HOST127.0.0.1Memcached server host (only used when CACHE_STORE=memcached).

Redis

VariableDefaultDescription
REDIS_CLIENTphpredisPHP Redis extension to use. phpredis or predis.
REDIS_HOST127.0.0.1Redis server hostname.
REDIS_PASSWORDnullRedis authentication password.
REDIS_PORT6379Redis server port.

Mail

VariableDefaultDescription
MAIL_MAILERlogMail driver. log writes emails to the log — no real emails are sent.
MAIL_SCHEMEnullTransport encryption scheme (tls, ssl, or null).
MAIL_HOST127.0.0.1SMTP server hostname.
MAIL_PORT2525SMTP server port.
MAIL_USERNAMEnullSMTP authentication username.
MAIL_PASSWORDnullSMTP authentication password.
MAIL_FROM_ADDRESS[email protected]Default sender address.
MAIL_FROM_NAME${APP_NAME}Default sender display name.

AWS / S3

VariableDefaultDescription
AWS_ACCESS_KEY_ID(empty)AWS IAM access key ID.
AWS_SECRET_ACCESS_KEY(empty)AWS IAM secret access key.
AWS_DEFAULT_REGIONus-east-1AWS region for S3 and other services.
AWS_BUCKET(empty)S3 bucket name for the s3 filesystem disk.
AWS_USE_PATH_STYLE_ENDPOINTfalseUse path-style S3 URLs (required for MinIO and some S3-compatible stores).

Vite

VariableDefaultDescription
VITE_APP_NAME${APP_NAME}Exposes the application name to front-end JavaScript.

Running tests

Run the full test suite with:
composer test
This runs:
php artisan config:clear && php artisan test
The config cache is cleared first to prevent stale values from affecting test results.

PHPUnit configuration

Test environment overrides are defined in phpunit.xml. The test suite uses in-memory SQLite so no database setup is needed:
<php>
    <env name="APP_ENV" value="testing"/>
    <env name="APP_MAINTENANCE_DRIVER" value="file"/>
    <env name="BCRYPT_ROUNDS" value="4"/>
    <env name="BROADCAST_CONNECTION" value="null"/>
    <env name="CACHE_STORE" value="array"/>
    <env name="DB_CONNECTION" value="sqlite"/>
    <env name="DB_DATABASE" value=":memory:"/>
    <env name="MAIL_MAILER" value="array"/>
    <env name="QUEUE_CONNECTION" value="sync"/>
    <env name="SESSION_DRIVER" value="array"/>
</php>
There are two test suites:
SuiteDirectoryPurpose
Unittests/UnitIsolated unit tests with no framework boot
Featuretests/FeatureFull HTTP/feature tests against a booted application
To run a single suite:
php artisan test --testsuite=Unit
php artisan test --testsuite=Feature

Build docs developers (and LLMs) love