Configuration
This guide covers the essential environment variables and configuration options for Open Core Business Suite.
Environment File
All configuration is managed through the .env file in your application root. Copy the example file if you haven't already:
cp .env.example .env
Application Settings
Core Settings
# Application name (displayed in browser title and emails)
APP_NAME="Open Core BS"
# Environment: local, staging, production
APP_ENV=production
# Application encryption key (generated by php artisan key:generate)
APP_KEY=
# Debug mode - set to false in production
APP_DEBUG=false
# Default timezone for the application
APP_TIMEZONE="Asia/Kolkata"
# Your application URL (no trailing slash)
APP_URL=https://yourdomain.com
# Demo mode - displays purchase/addon links banner
APP_DEMO=false
For production environments:
- Set
APP_ENV=production - Set
APP_DEBUG=false - Set
APP_DEMO=false
Localization
# Default locale
APP_LOCALE=en
# Fallback locale when translation is missing
APP_FALLBACK_LOCALE=en
# Faker locale for seeding test data
APP_FAKER_LOCALE=en_US
Database Configuration
# Database connection type
DB_CONNECTION=mysql
# Database host
DB_HOST=127.0.0.1
# Database port
DB_PORT=3306
# Database name
DB_DATABASE=opencorebs
# Database username
DB_USERNAME=root
# Database password
DB_PASSWORD=your_secure_password
MySQL Dump Path (For Backups)
If you're using the backup module, specify the path to MySQL binaries:
# Windows example
DB_MYSQL_DUMP_PATH="C:/laragon/bin/mysql/mysql-8.0.30-winx64/bin"
# Linux (usually not needed, uses system PATH)
# DB_MYSQL_DUMP_PATH="/usr/bin"
Authentication
JWT Configuration
JWT (JSON Web Token) is used for API authentication:
# JWT secret key (generated by php artisan jwt:secret)
JWT_SECRET=your_jwt_secret_here
Generate the JWT secret with:
php artisan jwt:secret
Email Configuration
Configure email settings for notifications and system emails:
# Mail driver: smtp, sendmail, mailgun, ses, postmark
MAIL_MAILER=smtp
# SMTP server host
MAIL_HOST=smtp.example.com
# SMTP port (587 for TLS, 465 for SSL)
MAIL_PORT=587
# SMTP username
MAIL_USERNAME="[email protected]"
# SMTP password
MAIL_PASSWORD="your_password"
# Encryption: tls, ssl, STARTTLS
MAIL_ENCRYPTION=STARTTLS
# From address for outgoing emails
MAIL_FROM_ADDRESS="[email protected]"
# From name for outgoing emails
MAIL_FROM_NAME="${APP_NAME}"
Common Email Providers
Gmail:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_app_password
MAIL_ENCRYPTION=tls
Outlook/Office 365:
MAIL_MAILER=smtp
MAIL_HOST=smtp-mail.outlook.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=STARTTLS
Queue Configuration
Queues handle background jobs like sending emails and processing exports:
# Queue driver: sync, database, redis
QUEUE_CONNECTION=database
| Driver | Description | Use Case |
|---|---|---|
sync | Immediate execution | Development, small deployments |
database | Database-backed queue | Most production environments |
redis | Redis-backed queue | High-performance, large scale |
For database or redis queues, you need to run the queue worker:
# Start queue worker
php artisan queue:work
# For production (with supervisor)
php artisan queue:work --sleep=3 --tries=3
Cache Configuration
# Cache driver: array, file, database, redis
CACHE_STORE=database
# Cache key prefix (useful for shared Redis instances)
CACHE_PREFIX=opencorebs_
| Driver | Description | Use Case |
|---|---|---|
array | In-memory (lost on request end) | Testing only |
file | File-based cache | Small deployments |
database | Database-backed cache | Standard production |
redis | Redis-backed cache | High-performance |
Redis Configuration
If using Redis for cache, queue, or sessions:
# Redis client: predis (pure PHP) or phpredis (requires extension)
REDIS_CLIENT=predis
# Redis server host
REDIS_HOST=127.0.0.1
# Redis password (null if not set)
REDIS_PASSWORD=null
# Redis port
REDIS_PORT=6379
To use Redis for all services:
CACHE_STORE=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
Session Configuration
# Session driver: file, cookie, database, redis
SESSION_DRIVER=file
# Session lifetime in minutes
SESSION_LIFETIME=120
# Encrypt session data
SESSION_ENCRYPT=false
# Session cookie path
SESSION_PATH=/
# Session cookie domain (null for current domain)
SESSION_DOMAIN=null
WebSocket Configuration (Laravel Reverb)
For real-time features like chat and notifications:
# Reverb application credentials
REVERB_APP_ID=your_app_id
REVERB_APP_KEY=your_app_key
REVERB_APP_SECRET=your_app_secret
# Reverb server settings
REVERB_HOST="0.0.0.0"
REVERB_PORT=8080
REVERB_SCHEME=http
# Vite settings (for frontend)
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
Start the Reverb server:
# Development
php artisan reverb:start --debug
# Production
php artisan reverb:start
External Services
Google Maps
For location-based features:
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
Logging Configuration
# Log channel: stack, single, daily, slack, etc.
LOG_CHANNEL=stack
# Log stack channels
LOG_STACK=single
# Deprecation logging channel
LOG_DEPRECATIONS_CHANNEL=null
# Minimum log level: debug, info, notice, warning, error, critical
LOG_LEVEL=debug
For production, consider using daily logging:
LOG_CHANNEL=daily
LOG_LEVEL=warning
Laravel Telescope (Development)
Telescope provides debugging and monitoring:
# Enable/disable Telescope
TELESCOPE_ENABLED=true
Disable Telescope in production or restrict access using middleware.
Security Settings
# Bcrypt rounds for password hashing (higher = more secure but slower)
BCRYPT_ROUNDS=12
Production Checklist
Before going live, verify these settings:
APP_ENV=production
APP_DEBUG=false
APP_DEMO=false
TELESCOPE_ENABLED=false
# Use proper cache and queue drivers
CACHE_STORE=database # or redis
QUEUE_CONNECTION=database # or redis
# Set secure session settings
SESSION_DRIVER=file
SESSION_ENCRYPT=true
Clear Configuration Cache
After changing .env values, clear the configuration cache:
php artisan config:clear
php artisan config:cache