git - .gitignore the database file in laravel -
i'm sharing laravel project co-worker. he's using mac , i'm using windows. there's specific change database.php file mac mamp. how can ignore file version controlling? should add file path in .gitignore @ root directory?
for configs use .env.development.php. file looks following
<?php return [ 'env' => 'development', 'db_username' => 'db_dev_username', 'db_password' => 'db_password', 'db_name' => 'dev_db' ]; inside file have database settings. create /app/config/development folder. inside settings want running. have database.php file in there , looks like
return array( 'connections' => array( 'mysql' => array( 'driver' => 'mysql', 'host' => getenv('db_host'), 'database' => getenv('db_name'), 'username' => getenv('db_username'), 'password' => getenv('db_password'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), ), ); /bootstrap/start.php - has inside it. if can't find value of env, defaults development.
$env = $app->detectenvironment(function() { return getenv('env') ?: 'development'; }); laravel should come .gitignore includes entry .env.* files won't push it.
my .gitignore file looks this:
/bootstrap/compiled.php /vendor composer.phar composer.lock .ds_store thumbs.db app/config/local app/config/development .env.*.php
Comments
Post a Comment