Skip to main content

Environment configuration

C.A.R. 911 uses Laravel’s environment-based configuration system. All environment-specific settings are stored in the .env file at the root of your project.
Never commit your .env file to version control. It contains sensitive information like database credentials and API keys. Always use .env.example as a template.

Application settings

Configure the core application settings in your .env file:

Basic configuration

.env
APP_NAME="C.A.R. 911"
APP_ENV=production
APP_KEY=base64:your_generated_key_here
APP_DEBUG=false
APP_URL=https://your-domain.com
  • APP_NAME: Display name for your application
  • APP_ENV: Environment mode (local, staging, or production)
  • APP_KEY: Encryption key (generated by php artisan key:generate)
  • APP_DEBUG: Enable detailed error messages (set to false in production)
  • APP_URL: Base URL where your application is hosted
The application timezone is set to America/Argentina/Buenos_Aires and locale is set to es (Spanish) by default in config/app.php.

Logging configuration

.env
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
  • LOG_CHANNEL: Logging driver (options: stack, single, daily, syslog)
  • LOG_LEVEL: Minimum log level (debug, info, notice, warning, error, critical, alert, emergency)
In production environments, set LOG_LEVEL to warning or error to avoid excessive log file growth.

Database configuration

C.A.R. 911 requires MySQL for data storage. Configure your database connection:
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=car_911
DB_USERNAME=your_username
DB_PASSWORD=your_secure_password

Database connection options

  • DB_CONNECTION: Database driver (C.A.R. 911 uses mysql)
  • DB_HOST: Database server address
  • DB_PORT: MySQL port (default: 3306)
  • DB_DATABASE: Database name
  • DB_USERNAME: Database user with appropriate privileges
  • DB_PASSWORD: Database password
Ensure your database user has permissions for SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, and ALTER operations.

Cache and session configuration

Optimize application performance with proper cache and session settings:
.env
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_CONNECTION=sync

Configuration options

  • CACHE_DRIVER: Cache storage method (file, redis, memcached, database)
  • SESSION_DRIVER: Session storage method (file, cookie, database, redis)
  • SESSION_LIFETIME: Session timeout in minutes
  • QUEUE_CONNECTION: Queue driver for background jobs (sync, database, redis)
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync

Broadcasting and queue configuration

For real-time features and background job processing:
.env
BROADCAST_DRIVER=log
FILESYSTEM_DRIVER=local
  • BROADCAST_DRIVER: Real-time event broadcasting (log, pusher, redis)
  • FILESYSTEM_DRIVER: File storage location (local, s3, public)

Mail configuration

Set up email notifications for system alerts:
.env
MAIL_MAILER=smtp
MAIL_HOST=smtp.your-provider.com
MAIL_PORT=587
MAIL_USERNAME=[email protected]
MAIL_PASSWORD=your_email_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"

Mail driver options

  • MAIL_MAILER: Email service (smtp, sendmail, mailgun, ses)
  • MAIL_ENCRYPTION: Encryption protocol (tls or ssl)
  • MAIL_FROM_ADDRESS: Default sender email address
  • MAIL_FROM_NAME: Default sender name

Application-specific configuration

C.A.R. 911 includes several application-specific settings configured in config/app.php:

Timezone and localization

config/app.php
'timezone' => 'America/Argentina/Buenos_Aires',
'locale' => 'es',
'fallback_locale' => 'es',
These settings are configured for Argentine Spanish localization. You can modify them in the configuration file if needed.

Service providers

C.A.R. 911 includes specialized service providers:
config/app.php
'providers' => [
    // Excel export functionality
    Maatwebsite\Excel\ExcelServiceProvider::class,
    
    // Role and permission management
    Spatie\Permission\PermissionServiceProvider::class,
],
These providers enable:
  • Excel exports: Generate reports and export data to spreadsheets
  • Permission management: Role-based access control for users

Security configuration

Encryption

The application uses AES-256-CBC encryption:
config/app.php
'cipher' => 'AES-256-CBC',
Your APP_KEY must be set for encryption to work properly.

Debug mode

Always set APP_DEBUG=false in production environments. Debug mode exposes sensitive information including:
  • Database queries
  • Environment variables
  • Stack traces
  • Application internals

Redis configuration (optional)

For improved performance with caching and queues:
.env
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Redis provides significant performance improvements for:
  • Session management
  • Cache storage
  • Queue processing
  • Real-time broadcasting

Verification

After configuring your environment, verify the settings:
1

Check configuration

View your current configuration:
php artisan config:show
2

Clear cached configuration

After making changes, clear the configuration cache:
php artisan config:clear
3

Cache configuration for production

In production, cache your configuration for better performance:
php artisan config:cache

Next steps

With C.A.R. 911 properly configured, you can now:
  • Set up user roles and permissions
  • Configure resource types (cameras, vehicles, dependencies)
  • Import existing data
  • Train staff on the CECOCO command center interface

Build docs developers (and LLMs) love