<
⌘K
GitHub v2.4.0

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

KeyDefaultDescription
DB_CONNECTIONmysqlDriver: mysql, pgsql, sqlite
DB_HOST127.0.0.1Database hostname
DB_PORT3306Database port
DB_CHARSETutf8mb4Character set
<