Reputation: 51
I just have a database issue on my project/app/config/database.php. I want to my application can change its database when detecting its database environment. For example, if application is develop in local database, the database setting are all local parameter. If it detect that the database is on the remote server, it changes into remote database settings.
'mysql' => array(
'driver' => 'mysql',
'host' => $_ENV['DB_HOST'],
'database' => $_ENV['DB_NAME'],
'username' => $_ENV['DB_USER'],
'password' => $_ENV['DB_PASSWORD'],
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => 'laravel_',
),
Upvotes: 0
Views: 1295
Reputation: 51
I've solved the problem, however, not by adding local folder in to config folder as the document said. I check the article Working with Configuration in Laravel 4, it is useful if you use .env.local.php to protect you local database configuration.
Upvotes: 1