Skip to main content
ElCoco reads its runtime configuration from a .env file in the project root. Laravel ships with a .env.example template that you copy and populate before your first run.

Initial setup

1

Copy the example file

cp .env.example .env
2

Generate an application key

php artisan key:generate
This writes a random 32-character base64 string to APP_KEY. Laravel uses it to encrypt sessions, cookies, and other payloads. The app will not boot without it.
3

Edit the file

Open .env in your editor and fill in the values for your environment. The sections below describe every variable.
4

Run migrations

php artisan migrate
Never commit your .env file to version control. It contains secrets. The repository’s .gitignore already excludes it.

App settings

APP_NAME
string
default:"Laravel"
Human-readable application name. Referenced in mail subjects and the frontend via VITE_APP_NAME. Set this to "ElCoco DMI" or your preferred display name.
APP_ENV
string
default:"local"
Current environment. Accepted values: local, staging, production. Controls error verbosity and certain framework behaviours.
APP_KEY
string
required
Encryption key generated by php artisan key:generate. Must be a base64:-prefixed 32-byte string. Required — the app will not start without this.
APP_DEBUG
boolean
default:"true"
When true, Laravel renders detailed exception pages. Set to false in production to prevent leaking stack traces.
APP_URL
string
default:"http://localhost"
The canonical URL of the application. Used when generating absolute URLs (e.g. PDF storage links, mail links). Must include the scheme (http:// or https://).
APP_LOCALE
string
default:"en"
Default locale for translations and date formatting.
APP_FALLBACK_LOCALE
string
default:"en"
Locale used when a translation key is missing in APP_LOCALE.
APP_FAKER_LOCALE
string
default:"en_US"
Locale used by Faker when generating fake data in factories and seeders.
APP_MAINTENANCE_DRIVER
string
default:"file"
Storage driver for maintenance-mode state. file writes a flag to disk; database stores it in the cache table. Uncomment APP_MAINTENANCE_STORE if you switch to database.
BCRYPT_ROUNDS
integer
default:"12"
Cost factor for bcrypt password hashing. Higher values are slower to compute, which is more secure but increases CPU usage on login. 12 is a reasonable production value.

Logging

LOG_CHANNEL
string
default:"stack"
Primary log channel. stack aggregates multiple channels defined in config/logging.php.
LOG_STACK
string
default:"single"
Channels included in the stack channel. Comma-separate multiple values (e.g. single,slack).
LOG_DEPRECATIONS_CHANNEL
string
default:"null"
Channel that receives PHP and Laravel deprecation notices. Set to null to silence them.
LOG_LEVEL
string
default:"debug"
Minimum severity to write. Values follow RFC 5424: debug, info, notice, warning, error, critical, alert, emergency. Use error in production.

Database

ElCoco defaults to SQLite for local development. Switch to MySQL for staging and production.
DB_CONNECTION=sqlite
# DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD are not required
Laravel will create the database at database/database.sqlite automatically on first migration.
DB_CONNECTION
string
default:"sqlite"
Database driver. Supported: sqlite, mysql, mariadb, pgsql, sqlsrv.
DB_HOST
string
default:"127.0.0.1"
Database server hostname or IP address. Not required for SQLite.
DB_PORT
integer
default:"3306"
Database port. Default is 3306 for MySQL/MariaDB.
DB_DATABASE
string
default:"laravel"
Name of the database to connect to.
DB_USERNAME
string
Database user. Not required for SQLite.
DB_PASSWORD
string
Database password. Not required for SQLite.

Cache and session

CACHE_STORE
string
default:"database"
Cache backend. ElCoco defaults to database, which stores cached values in the cache table. Other options: file, redis, memcached, array.
CACHE_PREFIX
string
Optional prefix applied to all cache keys. Useful when multiple apps share one Redis or Memcached instance.
SESSION_DRIVER
string
default:"database"
Session backend. database persists sessions in the sessions table. Other options: file, cookie, redis, array.
SESSION_LIFETIME
integer
default:"120"
Minutes before an idle session expires.
SESSION_ENCRYPT
boolean
default:"false"
When true, session data is encrypted at rest using APP_KEY.
SESSION_PATH
string
default:"/"
Cookie path scope. / makes the session cookie available site-wide.
SESSION_DOMAIN
string
default:"null"
Cookie domain. null defaults to the current hostname. Set to .yourdomain.com to share a session across subdomains.

Queue

QUEUE_CONNECTION
string
default:"database"
Queue driver. ElCoco defaults to database (jobs are stored in the jobs table). Other options: sync (process inline, no worker needed), redis, sqs.
BROADCAST_CONNECTION
string
default:"log"
Real-time broadcast driver. log writes events to the log file instead of broadcasting. Change to pusher or reverb if you add WebSocket features.

Mail

ElCoco sends meeting confirmation emails with PDF attachments via QuoteReplyMail. See Email configuration for the full mail flow.
MAIL_MAILER
string
default:"log"
Mail transport to use. log writes emails to the Laravel log (useful for local dev). Set to smtp for real delivery.
MAIL_SCHEME
string
TLS scheme for SMTP. Accepted values: tls, ssl, or leave blank. When using port 465, set this to ssl.
MAIL_HOST
string
default:"127.0.0.1"
SMTP server hostname (e.g. smtp.mailgun.org, smtp.gmail.com).
MAIL_PORT
integer
default:"2525"
SMTP port. Common values: 587 (STARTTLS), 465 (SSL), 25 (unencrypted).
MAIL_USERNAME
string
SMTP authentication username.
MAIL_PASSWORD
string
SMTP authentication password.
MAIL_FROM_ADDRESS
string
The From: address on all outgoing mail. Required for production — use a verified sender address.
MAIL_FROM_NAME
string
default:"${APP_NAME}"
The From: display name. Defaults to the value of APP_NAME.

Filesystem

FILESYSTEM_DISK
string
default:"local"
Default storage disk. ElCoco also uses the public disk explicitly (via Storage::disk('public')) to store generated PDFs at storage/app/public/quotes/.
AWS_ACCESS_KEY_ID
string
AWS access key ID. Required only if you switch the public disk to S3.
AWS_SECRET_ACCESS_KEY
string
AWS secret access key.
AWS_DEFAULT_REGION
string
default:"us-east-1"
AWS region for S3 and other services.
AWS_BUCKET
string
S3 bucket name for file storage.
AWS_USE_PATH_STYLE_ENDPOINT
boolean
default:"false"
Enable path-style S3 endpoint. Required for S3-compatible services like MinIO.

Redis and Memcached

These variables are only needed if you switch the cache, session, or queue driver to redis or memcached.
REDIS_CLIENT
string
default:"phpredis"
PHP Redis extension to use. phpredis requires the ext-redis PHP extension; predis uses the pure-PHP predis/predis package.
REDIS_HOST
string
default:"127.0.0.1"
Redis server hostname.
REDIS_PASSWORD
string
default:"null"
Redis authentication password. null disables authentication.
REDIS_PORT
integer
default:"6379"
Redis server port.
MEMCACHED_HOST
string
default:"127.0.0.1"
Memcached server hostname.

Sanctum

Laravel Sanctum provides API token authentication for the /api/v1/* protected endpoints.
ElCoco’s SPA uses Sanctum’s cookie-based session authentication (via GET /sanctum/csrf-cookie), so API tokens are only needed for external integrations.
VITE_APP_NAME
string
default:"${APP_NAME}"
Exposes the application name to the Vite frontend build. Interpolated from APP_NAME at build time.

Example production .env

APP_NAME="ElCoco DMI"
APP_ENV=production
APP_KEY=base64:YOUR_GENERATED_KEY_HERE
APP_DEBUG=false
APP_URL=https://cotizaciones.dmi.com

LOG_CHANNEL=stack
LOG_LEVEL=error

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=elcoco_prod
DB_USERNAME=elcoco
DB_PASSWORD=strong_password_here

SESSION_DRIVER=database
SESSION_LIFETIME=120

CACHE_STORE=database
QUEUE_CONNECTION=database

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME[email protected]
MAIL_PASSWORD=mailgun_password
MAIL_FROM_ADDRESS[email protected]
MAIL_FROM_NAME="DMI Cotizaciones"

FILESYSTEM_DISK=local

Build docs developers (and LLMs) love