Laravel 4.2 Setup Working Environment

Laravel 4.2 setup working environment is an important task should do at the beginning a project. Config files, Git, Gitignore is things you should take care. The below will show you the way to store config files to separate working environment as development, staging and production.

A man who conquers himself is greater than one who conquers a thousand men in battle

A man who conquers himself is greater than one who conquers a thousand men in battle

Detect Working Environment boostrap/start.php:

For security reason, from Laravel 4.1,  detectEnvironment function only supports hostname.

Create directories in app/config:

Push config files (e.g database.php, app.php …) to directories that you pretend use for each environment, it will be override the default config value.