Skip to main content

Environment Configuration

Heimerdingeris configured through environment variables stored in the .env file. This file is created by copying .env.example during installation.
Never commit your .env file to version control. It contains sensitive API keys and credentials. Always keep .env.example updated with new variables (using placeholder values).

Core Application Settings

Configure basic application behavior:
.env
APP_NAME=Heimerdinger
APP_ENV=local
APP_KEY=base64:generated_key_here
APP_DEBUG=true
APP_TIMEZONE=Europe/Amsterdam
APP_URL=http://127.0.0.1:8000
APP_NAME
string
default:"Heimerdinger"
Application name displayed in the UI and emails (.env.example:1)
APP_ENV
string
default:"local"
Environment type: local, staging, or production (.env.example:2)
Set to production for live deployments to enable proper error handling and caching.
APP_KEY
string
required
Encryption key generated by php artisan key:generate (.env.example:3)Used for encrypting sessions, cookies, and other sensitive data.
APP_DEBUG
boolean
default:"true"
Enable detailed error messages (.env.example:4)
Always set to false in production to prevent exposing sensitive information.
APP_TIMEZONE
string
default:"Europe/Amsterdam"
Application timezone for timestamp storage and display (.env.example:5)
APP_URL
string
required
Base URL of your application (.env.example:6)Used for generating absolute URLs, email links, and asset paths.

Locale Settings

.env
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_LOCALE
string
default:"en"
Primary application language (.env.example:10)
APP_FALLBACK_LOCALE
string
default:"en"
Fallback language when translations are missing (.env.example:11)

Database Configuration

Configure MySQL database connection:
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=heimerdinger_db
DB_USERNAME=root
DB_PASSWORD=your_secure_password
DB_CONNECTION
string
default:"mysql"
Database driver (currently only MySQL supported) (.env.example:48)
DB_HOST
string
default:"127.0.0.1"
Database server hostname or IP address (.env.example:49)
DB_PORT
integer
default:"3306"
MySQL server port (.env.example:50)
DB_DATABASE
string
required
Database name (.env.example:51)Ensure this database exists and uses utf8mb4 character set (config/database.php:24).
DB_USERNAME
string
required
Database username (.env.example:52)
DB_PASSWORD
string
required
Database password (.env.example:53)

Database Configuration Details

The database connection is configured in config/database.php:15-35 with the following settings:
  • Character Set: utf8mb4 for full Unicode support including emojis
  • Collation: utf8mb4_unicode_ci for case-insensitive comparisons
  • Connection Timeout: 15 seconds (config/database.php:31)
  • Strict Mode: Enabled for data integrity (config/database.php:28)

Riot Games API Configuration

Configure integration with Riot Games services:
.env
RGAPI_KEY="RGAPI-00000000-0000-0000-0000-000000000000"
USER_AGENT="Heimerdinger/1.0 (Heimerdinger.lol) PHP"
RGAPI_KEY
string
required
Your Riot Games API key (.env.example:28)Obtain from the Riot Developer Portal. Development keys expire after 24 hours; apply for a production key for permanent access.
USER_AGENT
string
required
User agent string for API requests (.env.example:32)Should identify your application to Riot’s servers as per their API guidelines.
Riot Games API has rate limits. Development keys allow 20 requests every 1 second and 100 requests every 2 minutes. Monitor your usage to avoid rate limiting.

External Service APIs

Configure additional data sources:
.env
LMI_API_KEY=your_lmi_key
BORIS_URL=https://boris.heimerdinger.lol
BORIS_API_KEY=your_boris_key
MAMC_SECRET=your_mamc_secret
LMI_API_KEY
string
LMI (LeagueMeta Insights) API key (.env.example:19)Used for additional champion statistics (config/services.php:12-14).
BORIS_URL
string
default:"https://boris.heimerdinger.lol"
Boris service endpoint URL (.env.example:20)
BORIS_API_KEY
string
Authentication key for Boris service (.env.example:21)Boris provides additional League of Legends data (config/services.php:16-19).
MAMC_SECRET
string
Meraki Analytics secret key (.env.example:29)

Laravel Octane Configuration

Boost performance with Laravel Octane:
.env
OCTANE_SERVER=swoole
OCTANE_HTTPS=false
OCTANE_SERVER
string
default:"swoole"
Octane server type (.env.example:25)Options: swoole or roadrunner. Swoole recommended for best performance.
OCTANE_HTTPS
boolean
default:"false"
Enable HTTPS for Octane server (.env.example:26)Set to true if serving over HTTPS directly (typically handled by reverse proxy).
Octane requires the Swoole PHP extension: pecl install swoole. See Laravel Octane Documentation for installation details.

Cloudflare Integration

Configure Cloudflare CDN and R2 storage:

Zone Configuration

.env
CLOUDFLARE_ZONE_ID="your_zone_id"
CLOUDFLARE_AUTH_BEARER="your_auth_token"
CLOUDFLARE_ZONE_ID
string
Cloudflare Zone ID for cache purging (.env.example:34)Found in Cloudflare Dashboard > Overview > Zone ID (config/cloudflare.php:15)
CLOUDFLARE_AUTH_BEARER
string
Cloudflare API Bearer token (.env.example:35)Generate in Cloudflare Dashboard > API Tokens (config/cloudflare.php:16)

R2 Storage Configuration

.env
FILESYSTEM_DISK=local
CLOUDFLARE_R2_ACCESS_KEY_ID=your_access_key
CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_secret_key
CLOUDFLARE_R2_BUCKET=your_bucket_name
CLOUDFLARE_R2_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
CLOUDFLARE_R2_URL=https://your-custom-domain.com
FILESYSTEM_DISK
string
default:"local"
Default filesystem disk (.env.example:57)Options: local, s3 (for R2), or other configured disks
CLOUDFLARE_R2_ACCESS_KEY_ID
string
R2 access key ID (.env.example:65)
CLOUDFLARE_R2_SECRET_ACCESS_KEY
string
R2 secret access key (.env.example:66)
CLOUDFLARE_R2_BUCKET
string
R2 bucket name (.env.example:67)
CLOUDFLARE_R2_ENDPOINT
string
R2 API endpoint (.env.example:68)
CLOUDFLARE_R2_URL
string
Public URL for accessing R2 assets (.env.example:69)
Cloudflare R2 is used for storing champion images, skin splash arts, and other static assets. It’s S3-compatible and uses the league/flysystem-aws-s3-v3 package (composer.json:23).

Security Configuration

hCaptcha Setup

Protect forms from bots with hCaptcha:
.env
HCAPTCHA_SECRET=your_secret_key
HCAPTCHA_SITEKEY=your_site_key
HCAPTCHA_SECRET
string
hCaptcha secret key (.env.example:40)Get from hCaptcha Dashboard
HCAPTCHA_SITEKEY
string
hCaptcha site key (.env.example:41)Public key embedded in forms

Honeypot Configuration

.env
HONEYPOT_NAME="honeypot"
HONEYPOT_NAME
string
default:"honeypot"
Honeypot field name for spam prevention (.env.example:38)Uses spatie/laravel-honeypot (composer.json:29) to detect spam bots.

Authentication Route

.env
LOGIN_ROUTE_NAME="/your/secret/login/route"
LOGIN_ROUTE_NAME
string
Custom login route path (.env.example:31)Obscure the login URL for additional security.

Logging and Monitoring

Log Configuration

.env
LOG_CHANNEL=stack
LOG_STACK=single,discord
LOG_LEVEL=debug
LOG_DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook
LOG_CHANNEL
string
default:"stack"
Primary logging channel (.env.example:43)
LOG_STACK
string
default:"single,discord"
Stack channels for multi-channel logging (.env.example:44)Logs to both file and Discord webhook
LOG_LEVEL
string
default:"debug"
Minimum log level (.env.example:46)Options: emergency, alert, critical, error, warning, notice, info, debug
Set to error or warning in production to reduce log noise.
LOG_DISCORD_WEBHOOK_URL
string
Discord webhook for error notifications (.env.example:8)Powered by marvinlabs/laravel-discord-logger (composer.json:24)

Discord Alerts

.env
DISCORD_ALERT_WEBHOOK="https://discord.com/api/webhooks/000000000000000000/"
DISCORD_ALERT_WEBHOOK
string
Webhook for application alerts (.env.example:37)Uses spatie/laravel-discord-alerts (composer.json:28) for important notifications.

Feature Flags

.env
APP_STAGING=false
SALES_ENABLED=false
APP_STAGING
boolean
default:"false"
Enable staging mode (.env.example:23)Shows staging indicators in the UI.
SALES_ENABLED
boolean
default:"false"
Enable sale rotation fetching (.env.example:95)Set to true to fetch live sale data from external APIs. When false, shows maintenance message.

Session Configuration

.env
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
SESSION_DRIVER
string
default:"database"
Session storage driver (.env.example:59)Options: file, cookie, database, redis, memcached
SESSION_LIFETIME
integer
default:"120"
Session lifetime in minutes (.env.example:60)
SESSION_ENCRYPT
boolean
default:"false"
Encrypt session data (.env.example:61)

Cache Configuration

.env
CACHE_STORE=file
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
CACHE_STORE
string
default:"file"
Cache driver (.env.example:56)Options: file, redis, memcached, database
For production, Redis is recommended for better performance. Install Redis and set CACHE_STORE=redis.

Queue Configuration

.env
QUEUE_CONNECTION=sync
QUEUE_CONNECTION
string
default:"sync"
Queue driver (.env.example:58)Options: sync, database, redis, sqs
Use sync for development (processes immediately). For production, use database or redis with queue workers.

Mail Configuration

.env
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
MAIL_MAILER
string
default:"smtp"
Mail transport driver (.env.example:77)
MAIL_HOST
string
default:"mailpit"
SMTP server hostname (.env.example:78)Mailpit is a local mail testing tool for development.
MAIL_FROM_ADDRESS
string
required
Default sender email address (.env.example:83)

Analytics Configuration

.env
GTAG_MEASUREMENT_ID="G-XXXXXXXXXX"
GTAG_MEASUREMENT_ID
string
Google Analytics 4 Measurement ID (.env.example:36)Track website analytics and user behavior.

Configuration Caching

For production deployments, cache your configuration:
1

Cache Configuration

php artisan config:cache
Combines all config files into a single cached file for faster loading.
2

Clear Cache (When Needed)

php artisan config:clear
Clear cached config when making changes during development.
When configuration is cached, the .env file is not loaded. All config values must be set via config/*.php files using env() helper.

Environment-Specific Configuration

Local Development

.env
APP_ENV=local
APP_DEBUG=true
LOG_LEVEL=debug
CACHE_STORE=file
QUEUE_CONNECTION=sync
MAIL_MAILER=log

Staging

.env
APP_ENV=staging
APP_STAGING=true
APP_DEBUG=false
LOG_LEVEL=info
CACHE_STORE=redis
QUEUE_CONNECTION=redis

Production

.env
APP_ENV=production
APP_DEBUG=false
LOG_LEVEL=error
CACHE_STORE=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
OCTANE_SERVER=swoole

Configuration Files Reference

Key configuration files in config/ directory:
Core application settings including timezone, locale, and service providers
Database connections and migration settings (config/database.php:1)
Third-party service credentials including LMI and Boris APIs (config/services.php:1)
Cloudflare zone and cache purging configuration (config/cloudflare.php:1)
Laravel Octane server configuration
hCaptcha integration settings
Spam prevention honeypot configuration

Validation

Verify your configuration:
php artisan about

Troubleshooting

Clear the config cache:
php artisan config:clear
php artisan cache:clear
Verify credentials and ensure MySQL is running:
php artisan db:show
Check that the database exists:
mysql -u root -p -e "SHOW DATABASES LIKE 'heimerdinger_db';"
Monitor your Riot API usage and consider:
  • Implementing caching for API responses
  • Requesting a production API key for higher rate limits
  • Adding delays between requests

Next Steps

Installation Guide

Return to installation steps if you need to set up the application

Contributing

Learn how to contribute to Heimerdinger.lol

Build docs developers (and LLMs) love