Include config for Heroku. [skip ci]

This commit is contained in:
James Cole 2017-04-27 02:39:48 +02:00
parent 743458b853
commit 26ceb9e3be
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
4 changed files with 21 additions and 64 deletions

View File

@ -1,56 +0,0 @@
APP_ENV=production
APP_DEBUG=false
APP_FORCE_SSL=false
APP_FORCE_ROOT=
APP_KEY=SomeRandomStringOf32CharsExactly
APP_LOG=errorlog
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USERNAME=homestead
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly
EXCHANGE_RATE_SERVICE=fixerio
GOOGLE_MAPS_API_KEY=
ANALYTICS_ID=
SITE_OWNER=mail@example.com
USE_ENCRYPTION=true
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
DEMO_USERNAME=
DEMO_PASSWORD=

View File

@ -108,8 +108,6 @@
"php artisan optimize"
],
"compile": [
"cp .env.heroku .env",
"touch storage/database/database.sqlite",
"php artisan migrate:refresh --seed --force"
]
},

View File

@ -66,8 +66,8 @@ return [
// own stuff:
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
Barryvdh\Debugbar\ServiceProvider::class,
//Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
//Barryvdh\Debugbar\ServiceProvider::class,
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
TwigBridge\ServiceProvider::class,
PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class,

View File

@ -9,6 +9,21 @@
* See the LICENSE file for details.
*/
// for heroku:
$databaseUrl = getenv('DATABASE_URL');
$host = '';
$username = '';
$password = '';
$database = '';
if (!($databaseUrl === false)) {
$options = parse_url($databaseUrl);
$host = $options['host'];
$username = $options['user'];
$password = $options['pass'];
$database = substr($options['path'], 1);
}
return [
'fetch' => PDO::FETCH_OBJ,
@ -36,11 +51,11 @@ return [
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'host' => env('DB_HOST', $host),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'database' => env('DB_DATABASE', $database),
'username' => env('DB_USERNAME', $username),
'password' => env('DB_PASSWORD', $password),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',