Environment File Setup
Creating the .env File
VIP2CARS uses a.env file for environment-specific configuration.
Application Settings
Basic Configuration
APP_NAME
APP_NAME
The name of your application. This is used in emails, notifications, and the UI.Default:
Recommended:
LaravelRecommended:
VIP2CARSAPP_ENV
APP_ENV
The application environment.Options:
Development:
Production:
local, staging, productionDevelopment:
localProduction:
productionAPP_KEY
APP_KEY
Encryption key for securing session data and encrypted values.
APP_DEBUG
APP_DEBUG
Enables detailed error messages.Development:
Production:
trueProduction:
falseAPP_URL
APP_URL
The base URL of your application.Development:
Production:
http://localhost:8000Production:
https://yourdomain.comLocalization Settings
- APP_LOCALE: Default language for the application
- APP_FALLBACK_LOCALE: Fallback language if translation is missing
- APP_FAKER_LOCALE: Locale for generating fake data in seeders
Security Settings
Default value of 12 provides a good balance between security and performance.
Database Configuration
MySQL Database (Recommended)
For production environments, configure MySQL/MariaDB:SQLite Database (Development)
For local development, SQLite is pre-configured:With SQLite, you don’t need to specify host, port, username, or password. The database file is stored at
database/database.sqlite.Additional Database Options
DB_CHARSET and DB_COLLATION
DB_CHARSET and DB_COLLATION
DB_SOCKET (Unix Socket)
DB_SOCKET (Unix Socket)
Session Configuration
SESSION_DRIVER
SESSION_DRIVER
Options:
file, cookie, database, redisDefault: database - Sessions are stored in the database.For production with multiple servers, use
redis or database for session persistence.SESSION_LIFETIME
SESSION_LIFETIME
Session lifetime in minutes.Default:
120 (2 hours)Cache Configuration
file- File-based cache (default for development)database- Database cache (default)redis- Redis cache (recommended for production)memcached- Memcached cache
For production environments, consider using Redis for better performance.
Queue Configuration
sync- Synchronous (no queue)database- Database queue (default)redis- Redis queue (recommended for production)
Mail Configuration
Development (Log)
storage/logs/laravel.log.
Production (SMTP)
Redis Configuration (Optional)
Redis is optional but recommended for production caching and queues.
Logging Configuration
Production Logging
debug- Detailed debug informationinfo- Informational messagesnotice- Normal but significant eventswarning- Warning messageserror- Error messagescritical- Critical conditionsalert- Action must be taken immediatelyemergency- System is unusable
Storage Configuration
local- Local storage instorage/apppublic- Public storage instorage/app/publics3- Amazon S3 (requires AWS configuration)
AWS S3 Configuration (Optional)
Vite Configuration
Maintenance Mode
Enable maintenance mode with
php artisan down and disable with php artisan up.Configuration Caching
After modifying your.env file in production: