Skip to main content

Configuration

DentControl uses Laravel’s robust configuration system to manage application settings. This guide covers environment configuration, database setup, and service configuration.

Environment Variables

DentControl stores sensitive configuration in the .env file at the root of your project.
1

Copy the example file

If you don’t have a .env file yet, copy the example:
cp .env.example .env
2

Generate application key

Generate a secure application key:
php artisan key:generate
This sets the APP_KEY variable, which is used for encryption.
3

Configure your environment

Edit the .env file with your application-specific settings.

Core Application Settings

APP_NAME=DentControl
APP_ENV=production
APP_KEY=base64:your-generated-key-here
APP_DEBUG=false
APP_URL=https://your-domain.com
Never set APP_DEBUG=true in production! This exposes sensitive information about your application.

Configuration Options

VariableDescriptionDefault
APP_NAMEApplication name displayed throughout the appLaravel
APP_ENVEnvironment (local, staging, production)local
APP_DEBUGEnable debug mode (only for development)true
APP_URLBase URL of your applicationhttp://localhost
BCRYPT_ROUNDSPassword hashing rounds (higher = more secure)12

Database Configuration

DentControl supports multiple database systems. By default, it uses SQLite for easy setup.

SQLite (Default)

DB_CONNECTION=sqlite
# No other DB variables needed
SQLite is perfect for development and small deployments. No additional database server required!

MySQL Configuration

MySQL
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dentcontrol
DB_USERNAME=your_username
DB_PASSWORD=your_secure_password

PostgreSQL Configuration

PostgreSQL
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=dentcontrol
DB_USERNAME=your_username
DB_PASSWORD=your_secure_password

Session Configuration

DentControl stores sessions in the database for better scalability.
Session Settings
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
VariableDescriptionDefault
SESSION_DRIVERWhere to store sessions (database, file, redis)database
SESSION_LIFETIMESession lifetime in minutes120
SESSION_ENCRYPTEncrypt session datafalse
Using database as the session driver requires running migrations to create the sessions table.

Cache Configuration

Caching improves application performance by storing frequently accessed data.
Cache Settings
CACHE_STORE=database
# CACHE_PREFIX=

Available Cache Drivers

  • database - Store cache in database (default)
  • file - Store cache in filesystem
  • redis - Use Redis for high-performance caching
  • memcached - Use Memcached for distributed caching

Redis Configuration (Optional)

If using Redis for caching or queues:
Redis
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

Queue Configuration

Queues allow you to defer time-consuming tasks for better performance.
Queue Settings
QUEUE_CONNECTION=database

Available Queue Drivers

  • database - Store jobs in database (default, no extra setup)
  • redis - Use Redis for faster queue processing
  • sync - Execute jobs immediately (for development/testing)
To process queued jobs, you need to run the queue worker:
php artisan queue:work

Mail Configuration

Configure email sending for notifications and password resets.
MAIL_MAILER=log
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
For Gmail, you need to use an App Password, not your regular Gmail password.

Filesystem Configuration

Configure where uploaded files (like clinic logos) are stored.
Filesystem
FILESYSTEM_DISK=local

Available Disks

  • local - Store files in storage/app
  • public - Store files in storage/app/public (accessible via public URL)
  • s3 - Store files on Amazon S3

Amazon S3 Configuration (Optional)

AWS S3
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=your-key-id
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket-name
AWS_USE_PATH_STYLE_ENDPOINT=false

Logging Configuration

Configure how application logs are stored.
Logging
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

Log Levels

  • debug - Detailed information for debugging
  • info - Interesting events
  • warning - Exceptional occurrences that are not errors
  • error - Runtime errors
In production, set LOG_LEVEL=error to reduce log file size.

Configuration Files

Laravel configuration files are located in the config/ directory:
FilePurpose
app.phpCore application settings
auth.phpAuthentication configuration
database.phpDatabase connections
mail.phpEmail configuration
cache.phpCache stores
queue.phpQueue connections
session.phpSession configuration
filesystems.phpFile storage
logging.phpLog channels
Don’t modify config files directly in production! Use environment variables in .env instead.

Caching Configuration

For better performance in production, cache your configuration:
php artisan config:cache
This compiles all configuration files into a single cached file.
After caching, changes to .env won’t take effect until you run php artisan config:clear.

Troubleshooting

If your configuration changes aren’t working:
  1. Clear the config cache:
    php artisan config:clear
    
  2. Clear all caches:
    php artisan cache:clear
    php artisan view:clear
    php artisan route:clear
    
  3. Restart your web server or queue workers
For SQLite:
  • Ensure database/database.sqlite exists
  • Check file permissions (must be writable)
For MySQL/PostgreSQL:
  • Verify database server is running
  • Check credentials in .env
  • Ensure database exists: CREATE DATABASE dentcontrol;
  • Test connection manually
  1. Check your SMTP credentials are correct
  2. Verify firewall allows outbound connections on mail port
  3. Test with log driver first to debug:
    MAIL_MAILER=log
    
  4. Check logs in storage/logs/laravel.log
Ensure Laravel can write to these directories:
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

Next Steps

Database Setup

Run migrations and seed your database

User Management

Create users and assign roles

Deployment

Deploy to production

Build docs developers (and LLMs) love