Sulaiman
Sulaiman

Reputation: 15

How can I pass additional parameters to database connection in Lumen?

I am trying to connect my Lumen app to an Amazon RDS PostgreSQL instance. In order to do so, I need to pass "sslmode" and "sslrootcert" parameters to the database connection.

In Laravel, I could serve them through an additional "options" array inside config/database.php. Since there is no config/database.php file in Lumen, how can I pass them?

Upvotes: 0

Views: 918

Answers (1)

David Barker
David Barker

Reputation: 14620

Lumen still uses config files behind the scenes. There is a config/database.php file in the framework root that defines the connections. You can override these by creating your own config/database.php from the root of the project. You can add your Postgres config as you would in Laravel.

Upvotes: 2

Related Questions