Laravel on Heroku
, (*1)
These are ServiceProviders that helps you use Laravel on Heroku., (*2)
functions
These provider wont be auto-discovered., (*3)
You should add setting to config/app.php., (*4)
- HerokuPostgresServiceProvider : Support to connect Heroku Postgres
- HerokuRedisServiceProvider : Support to connect Heroku Redis
Usage
$ composer require chatbox-inc/laravel-heroku
Heroku Postgres / Heroku Redis
HerokuPostgresServiceProvider をサービスプロバイダとして公開, (*5)
For Laravel, (*6)
// at config/app.php
"providers" => [
HerokuPostgresServiceProvider::class,
]
After that, You can use herokupg keyword as DB_CONNECTION value., (*7)
DATABASE_URL will auto parsed on connecting DB., (*8)
DB_CONNECTION=herokupg
DATABASE_URL=postgres://xxxxxxxxxxxxxxxxxxxxxxxxx
Heroku Redis
HerokuRedisServiceProvider will auto setup your redis connection., (*9)
REDIS_URL will automatically parsed to connect Redis., (*10)
Procfile
cp vendor/chatbox-inc/laravel-heroku/Procfile Procfile