Configuration
All configuration lives in the config/ directory and is environment-aware via .env files.
Environment File
Copy .env.example to .env and fill in your values:
APP_NAME=DevPortal
APP_ENV=local # local | staging | production
APP_DEBUG=true
APP_URL=http://localhost:8080
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_db
DB_USERNAME=root
DB_PASSWORD=secret
CACHE_DRIVER=file # file | redis | memcached
SESSION_LIFETIME=120
App Config
Fine-grained options live in config/app.php:
return [
'name' => env('APP_NAME', 'DevPortal'),
'debug' => env('APP_DEBUG', false),
'timezone' => 'UTC',
'locale' => 'en',
'key' => env('APP_KEY'), // run: php artisan key:generate
];
⚠ Security
Never commit your
.env file to version control. Add it to .gitignore immediately.
Database Config
| Key | Default | Description |
|---|---|---|
DB_CONNECTION | mysql | Driver: mysql, pgsql, sqlite |
DB_HOST | 127.0.0.1 | Database hostname |
DB_PORT | 3306 | Database port |
DB_CHARSET | utf8mb4 | Character set |