Skip to main content

Environment Variable Configuration Guide

This document explains what each .env value is used for and what to configure it with for this project.

How To Use This Guide

  • Start from .env.example.
  • Copy it to .env.
  • Fill required values first, then optional integrations.
  • For deployed environments, store sensitive values in your secret manager and inject them at runtime.

Quick Start (Local)

Minimum values to run app + queue worker locally:

APP_NAME="Scottsdale Hub"
APP_ENV=local
APP_KEY=base64:GENERATED_BY_ARTISAN
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000

DB_CONNECTION=sqlite
QUEUE_CONNECTION=sqs

AWS_DEFAULT_REGION=us-west-2
SQS_PREFIX=https://sqs.us-west-2.amazonaws.com/YOUR_AWS_ACCOUNT_ID

SCOTTSDALE_WEBHOOK_SECRET=change-me-local
BUSINESS_CENTRAL_WEBHOOK_SECRET=change-me-local
SDM_RETAIL_WEBHOOK_SECRET=change-me-local
SDM_WHOLESALE_WEBHOOK_SECRET=change-me-local
WALMART_WEBHOOK_SECRET=change-me-local
EBAY_WEBHOOK_SECRET=change-me-local
WOOCOMMERCE_WEBHOOK_SECRET=change-me-local

Generate app key after creating .env:

php artisan key:generate

Variable Reference

Application

VariableWhat It Is ForWhat To Configure
APP_NAMEApp display name for logs/UI.Local: Scottsdale Hub or team standard name.
APP_ENVEnvironment behavior flags (local, testing, production).Local: local. Shared dev: development or team standard. Prod: production.
APP_KEYEncryption/signing key used by Laravel.Required. Generate with php artisan key:generate. Never reuse insecure keys.
APP_DEBUGVerbose error pages and stack traces.Local: true. Deployed: false.
APP_URLBase URL used for generated links and callbacks.Local: http://127.0.0.1:8000 (or your local host). Deployed: environment URL.
APP_LOCALEDefault locale.en unless localized content is required.
APP_FALLBACK_LOCALEFallback locale if translation missing.en.
APP_FAKER_LOCALEFaker locale used in seed/test data.en_US by default.
APP_VERSIONApp version string for diagnostics/logging.Semantic version, for example 1.0.0.

Ngrok and Local Webhook Exposure

VariableWhat It Is ForWhat To Configure
NGROK_DOMAINFixed ngrok domain for local webhook endpoints.Your reserved ngrok domain or blank if not using reserved domain.
NGROK_PORTLocal port ngrok forwards to.Usually 8000.
NGROK_ENABLEDToggles ngrok-aware behavior for local workflows.Local webhook testing: true. Otherwise false.
NGROK_AUTH_TOKENngrok account auth token.Set from ngrok dashboard for authenticated tunnels.
NGROK_REGIONngrok region routing.Usually us, unless your account/workflow requires another region.

Maintenance and Runtime

VariableWhat It Is ForWhat To Configure
APP_MAINTENANCE_DRIVERMaintenance mode storage backend.Default file is fine unless centralized maintenance state is needed.
APP_MAINTENANCE_STOREStore used when maintenance driver supports cache/database stores.Usually leave commented unless using centralized store.
PHP_CLI_SERVER_WORKERSNumber of PHP built-in server workers.Optional for local tuning; typically leave unset.
BCRYPT_ROUNDSPassword hashing cost factor.Local default 12. Increase carefully only if needed.

Logging

VariableWhat It Is ForWhat To Configure
LOG_CHANNELPrimary Laravel logging channel.Local: stack or single. Deployed: team standard.
LOG_STACKChannels included in stack logger.Local default single.
LOG_DEPRECATIONS_CHANNELWhere PHP/framework deprecations go.null or dedicated channel depending on observability setup.
LOG_LEVELMinimum severity to record.Local: debug. Deployed: commonly info or warning.
BUSINESS_CENTRAL_LOCAL_LOGGINGEnables extra local logging for BC integration flows.Local troubleshooting: true. Deployed: usually false unless needed.
BUSINESS_CENTRAL_LOG_LEVELBC integration log threshold.Local: debug. Deployed: info or warning.
BUSINESS_CENTRAL_LOG_DAILY_DAYSBC log retention days.Default 14, adjust per retention policy.

Queue Logging Controls

VariableWhat It Is ForWhat To Configure
QUEUE_LOG_ENABLEDEnables queue-specific log channel output.Local debugging: true. Default: false.
QUEUE_LOG_LEVELQueue log severity threshold.Local: debug. Deployed: info/warning.
QUEUE_LOG_DAILY_DAYSQueue log retention in days.Default 14 unless policy differs.

Database

VariableWhat It Is ForWhat To Configure
DB_CONNECTIONDatabase driver selection.Local default in template: sqlite. For MySQL use mysql.
DB_HOSTMySQL host.Set when using MySQL (for example 127.0.0.1).
DB_PORTMySQL port.Usually 3306 (or tunnel port like 3307/3308/3309).
DB_DATABASEDatabase name.Local DB/schema name.
DB_USERNAMEDatabase user.Local DB user.
DB_PASSWORDDatabase password.Local DB password from secure source.

Session / Cache / Core Service Connections

VariableWhat It Is ForWhat To Configure
SESSION_DRIVERSession backend.Template uses database; ensure session table migration exists.
SESSION_LIFETIMESession duration in minutes.Default 120 unless policy differs.
SESSION_ENCRYPTEncrypts session payloads.Default false unless requirement says otherwise.
SESSION_PATHSession cookie path.Usually /.
SESSION_DOMAINSession cookie domain.null for local, set to app domain in deployed envs.
BROADCAST_CONNECTIONBroadcast driver.log in local unless real broadcaster is configured.
FILESYSTEM_DISKDefault filesystem disk.local for local development.
QUEUE_CONNECTIONQueue driver.For this project local flow: sqs.
CACHE_STORECache backend.Template uses database; ensure cache tables exist.
CACHE_PREFIXOptional shared cache key prefix.Set when multiple apps share cache backend.

AWS and SQS

VariableWhat It Is ForWhat To Configure
AWS_ACCESS_KEY_IDAWS API access key.Set if not using profile-based credentials. Keep secret.
AWS_SECRET_ACCESS_KEYAWS API secret key.Set if not using profile-based credentials. Keep secret.
AWS_DEFAULT_REGIONAWS region for SQS/S3/etc.us-west-2 for current project defaults.
SQS_PREFIXBase queue URL prefix (account + region).https://sqs.us-west-2.amazonaws.com/<AWS_ACCOUNT_ID>.
SQS_SUFFIXOptional queue name suffix.Usually blank unless naming strategy requires it.

Notes:

  • Local queue naming convention is hublocal-* after deploying local infra.
  • You can use AWS profile credentials instead of static key env vars.

Memcached and Redis

VariableWhat It Is ForWhat To Configure
MEMCACHED_HOSTMemcached host when memcached is used.Usually 127.0.0.1 or service host.
REDIS_CLIENTRedis PHP client driver.Template uses phpredis.
REDIS_HOSTRedis host.Local default 127.0.0.1.
REDIS_PASSWORDRedis auth password.null locally unless auth is enabled.
REDIS_PORTRedis port.Usually 6379.

Mail

VariableWhat It Is ForWhat To Configure
MAIL_MAILERMail transport driver.Local often smtp (Mailpit/Mailhog) or log.
MAIL_SCHEMESMTP scheme override.Usually null unless TLS/SSL override needed.
MAIL_HOSTSMTP host.Local Mailpit often 127.0.0.1.
MAIL_PORTSMTP port.Local Mailpit commonly 1025.
MAIL_USERNAMESMTP username.null locally, set in deployed env if SMTP auth required.
MAIL_PASSWORDSMTP password.null locally, secure secret in deployed env.
MAIL_FROM_ADDRESSDefault sender email.Project default: [email protected].
MAIL_FROM_NAMEDefault sender name.Project default: Scottsdale Hub.
MAILGUN_DOMAINMailgun domain if Mailgun transport used.Set only when using Mailgun.
MAILGUN_SECRETMailgun API key.Set securely when using Mailgun.
MAILGUN_ENDPOINTMailgun API endpoint host.Usually api.mailgun.net.

S3 / Object Storage

VariableWhat It Is ForWhat To Configure
AWS_BUCKETS3 bucket name for storage operations.Set bucket name if S3 disk used.
AWS_ROOTOptional prefix/path root within bucket.Leave blank or set app-specific folder prefix.
AWS_USE_PATH_STYLE_ENDPOINTPath-style addressing for S3-compatible providers.false for AWS S3; true for some S3-compatible local services.

Frontend Build

VariableWhat It Is ForWhat To Configure
VITE_APP_NAMEFrontend-exposed app name.Usually keep "${APP_NAME}".

Webhook Signature Secrets

These secrets validate inbound webhook signatures per source.

VariableWhat It Is ForWhat To Configure
SCOTTSDALE_WEBHOOK_SECRETSignature validation for Scottsdale webhook source.Set to secret shared with source system.
BUSINESS_CENTRAL_WEBHOOK_SECRETSignature validation for Business Central webhook source.Set to BC webhook signing secret.
SDM_RETAIL_WEBHOOK_SECRETSignature validation for SDM retail webhooks.Set to channel secret.
SDM_WHOLESALE_WEBHOOK_SECRETSignature validation for SDM wholesale webhooks.Set to channel secret.
WALMART_WEBHOOK_SECRETGeneric Walmart webhook secret if used by flow.Set to Walmart-provided value.
EBAY_WEBHOOK_SECRETeBay webhook signature secret.Set to eBay-provided value.
WOOCOMMERCE_WEBHOOK_SECRETWooCommerce webhook secret.Set to WooCommerce webhook secret.
WOOCOMMERCE_WEBHOOK_SIGNATURE_HEADERHeader key that carries Woo signature.Default X-WC-Webhook-Signature.
WOOCOMMERCE_WEBHOOK_SIGNATURE_ALGORITHMHMAC algorithm for Woo signature verify.Default sha256.

Connector/API Shared Secrets

VariableWhat It Is ForWhat To Configure
BUSINESS_CENTRAL_SECRETShared secret/credential for BC connector operations.Set from BC integration credentials.
WOOCOMMERCE_SECRETShared secret for WooCommerce connector calls.Set from WooCommerce integration credentials.
WALMART_SECRETShared secret for Walmart connector calls.Set from Walmart integration credentials.
EBAY_SECRETShared secret for eBay connector calls.Set from eBay integration credentials.

Walmart Integration (Sandbox and Production)

VariableWhat It Is ForWhat To Configure
WALMART_ENVSelects active Walmart environment.sandbox for local/dev testing, production for production runs.
WALMART_SANDBOX_BASE_URLWalmart sandbox API base URL.Keep default unless Walmart changes endpoint.
WALMART_PRODUCTION_BASE_URLWalmart production API base URL.Keep default unless Walmart changes endpoint.
WALMART_SANDBOX_WEBHOOK_SECRETSandbox webhook signature secret.Set to sandbox-specific secret.
WALMART_PRODUCTION_WEBHOOK_SECRETProduction webhook signature secret.Set to production-specific secret.
WALMART_SANDBOX_WEBHOOK_RECEIVER_URLPublic URL Walmart sandbox sends webhooks to.Local with ngrok/public tunnel URL.
WALMART_PRODUCTION_WEBHOOK_RECEIVER_URLProduction webhook callback URL.Production API URL.
WALMART_SANDBOX_CONSUMER_IDSandbox API consumer ID.Set from Walmart developer portal sandbox credentials.
WALMART_SANDBOX_PRIVATE_KEYSandbox API private key content/value.Set from secure secret store.
WALMART_PRODUCTION_CONSUMER_IDProduction API consumer ID.Set from Walmart production credentials.
WALMART_PRODUCTION_PRIVATE_KEYProduction API private key content/value.Set from secure secret store.

Sync and Worker Tuning

VariableWhat It Is ForWhat To Configure
SYNC_BATCH_SIZEBatch size for sync processing units.Default 500; tune based on memory/throughput.
SYNC_TIMEOUT_SECONDSTimeout for sync operations.Default 90; raise for slower upstream systems.
QUEUE_NAMESComma-separated logical queue taxonomy.Keep aligned with config/integration_queues.php.
QUEUE_TRIESMax retry attempts per failed job.Default 5.
QUEUE_BACKOFF_SECONDSDelay between retries.Default 60.
QUEUE_SLEEP_SECONDSWorker sleep when no job is available.Default 3.
QUEUE_WORKER_TIMEOUT_SECONDSWorker hard timeout per job.Default 120.
QUEUE_WORKER_MEMORY_MBWorker memory cap before restart.Default 512.

Required vs Optional Checklist

Required to boot local app reliably:

  • APP_KEY
  • APP_URL
  • Database settings for chosen driver
  • SQS settings when QUEUE_CONNECTION=sqs (AWS_DEFAULT_REGION, SQS_PREFIX, AWS creds/profile)
  • Webhook secrets for any channel you are actively testing

Optional unless integration is enabled:

  • Walmart sandbox/production credential set
  • Mailgun values
  • S3 bucket values
  • ngrok values (only needed for public webhook callbacks)

Security Notes

  • Never commit real credentials to git.
  • Keep production secrets in a managed secret store.
  • Rotate webhook/API secrets when onboarding or offboarding systems.
  • Use environment-specific values and do not reuse production secrets in local/dev.