PHPackages                             itsdamien/laravel-heroku-config-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. itsdamien/laravel-heroku-config-parser

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

itsdamien/laravel-heroku-config-parser
======================================

Parse Heroku config vars like DATABASE\_URL or REDIS\_URL to work with Laravel.

v1.1(8y ago)229.4k1MITPHPPHP &gt;=5.6.4

Since Mar 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/damiencriado/laravel-heroku-config-parser)[ Packagist](https://packagist.org/packages/itsdamien/laravel-heroku-config-parser)[ RSS](/packages/itsdamien-laravel-heroku-config-parser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Laravel Heroku Config Parser
----------------------------

[](#laravel-heroku-config-parser)

[![Latest Stable Version](https://camo.githubusercontent.com/325efe3ea11c3bb909718ac6de81e57507ecd2030c909ba003bf0e46c0c16863/68747470733a2f2f706f7365722e707567782e6f72672f69747364616d69656e2f6c61726176656c2d6865726f6b752d636f6e6669672d7061727365722f762f737461626c65)](https://packagist.org/packages/itsdamien/laravel-heroku-config-parser)[![Total Downloads](https://camo.githubusercontent.com/b8ecf97cc80fa1f3010c8d1b8ab61ba82ce7df046a79b53bc19166349c34df48/68747470733a2f2f706f7365722e707567782e6f72672f69747364616d69656e2f6c61726176656c2d6865726f6b752d636f6e6669672d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/itsdamien/laravel-heroku-config-parser)[![License](https://camo.githubusercontent.com/9765f9455f995b05eb704a2bc77558b66f96cf2bbac5028bdfe90d47fb888c1a/68747470733a2f2f706f7365722e707567782e6f72672f69747364616d69656e2f6c61726176656c2d6865726f6b752d636f6e6669672d7061727365722f6c6963656e7365)](https://packagist.org/packages/itsdamien/laravel-heroku-config-parser)[![Build Status](https://camo.githubusercontent.com/591e2f410810ad7f8c4d3aa247969e6629f3664c46f870aaed33df3c2bf86fd0/68747470733a2f2f7472617669732d63692e6f72672f69747344616d69656e2f6c61726176656c2d6865726f6b752d636f6e6669672d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/itsDamien/laravel-heroku-config-parser)[![Maintainability](https://camo.githubusercontent.com/ffb52c79b998b160c0918a5e2664bb07cf0895228dab9687327b07a53ae7a313/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61383831663665323434336239393731353039662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/itsDamien/laravel-heroku-config-parser/maintainability)[![Test Coverage](https://camo.githubusercontent.com/e4657d4269eaf239397917e4ddf40671e37d1a72711e9f27de2d6bc648ee4a9c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61383831663665323434336239393731353039662f746573745f636f766572616765)](https://codeclimate.com/github/itsDamien/laravel-heroku-config-parser/test_coverage)[![StyleCI](https://camo.githubusercontent.com/959dd335ceddc6bbfac207d4099b24356752f237c12189dff37133588ebbd24c/68747470733a2f2f7374796c6563692e696f2f7265706f732f38333431343034302f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/83414040)

Parse Heroku config vars like `DATABASE_URL` or `REDIS_URL` to work with Laravel.

Important
---------

[](#important)

Due to a breaking change in Laravel 5.8 (thanks  for the feedback), you can use this method to achieve the same goal:

[\#2 (comment)](https://github.com/damiencriado/laravel-heroku-config-parser/issues/2#issuecomment-469709141)

### Breaking change:

[](#breaking-change)

[laravel/framework#27695](https://github.com/laravel/framework/issues/27695)

[laravel/docs#5039](https://github.com/laravel/docs/pull/5039)

Why
---

[](#why)

When adding a database or a redis server to your Heroku app, Heroku add a URL config var like this: `DATABASE_URL=postgres://usr:pwd@localhost:5432/hellodb`

Unfortunately, Laravel can't read this var, so you probably parsed it manually like this:

```
heroku config:set DB_CONNECTION=pgsql
heroku config:set DB_HOST=localhost
heroku config:set DB_PORT=5432
heroku config:set DB_DATABASE=hellodb
heroku config:set DB_USERNAME=usr
heroku config:set DB_PASSWORD=pwd
```

**Laravel Heroku Config Parser** parse automatically your `DATABASE_URL` and `REDIS_URL` to dynamically set all vars needed by Laravel [(see the list)](#list-of-injected-config-var).

Installation
------------

[](#installation)

Installation using composer:

```
composer require itsdamien/laravel-heroku-config-parser

```

### Heroku

[](#heroku)

Add these config vars:

```
heroku config:set KEY_DATABASE=DATABASE_URL
heroku config:set KEY_REDIS=REDIS_URL
```

### Laravel

[](#laravel)

Add this block code to the top of your `config/database.php`:

```
if (class_exists('\ItsDamien\Heroku\Config\Parse')) {
    new \ItsDamien\Heroku\Config\Parse();
}
```

**Enjoy !**

ENV vars created
----------------

[](#env-vars-created)

DATABASE\_URLpostgres://usr:pwd@ec2-s1:5432/db1mysql://usr:pwd@ec2-s2:3306/db2DB\_CONNECTIONpgsqlmysqlDB\_HOST ec2-s1 ec2-s2 DB\_PORT 5432 3306 DB\_DATABASEdb1db2DB\_USERNAMEusrusrDB\_PASSWORD pwd pwd REDIS\_URLredis://h:pwd@ec2-s1:11469REDIS\_HOSTec2-s1REDIS\_PORT11469REDIS\_PASSWORDpwdCustomize the config var who will be parsed
-------------------------------------------

[](#customize-the-config-var-who-will-be-parsed)

You can select wich config var will be parsed by setting `KEY_DATABASE` and `KEY_REDIS` like this:

```
heroku config:set KEY_DATABASE=HEROKU_POSTGRESQL_BRONZE
heroku config:set KEY_REDIS=REDIS_URL_BACKUP
```

License
-------

[](#license)

**Laravel Heroku Config Parser** is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity61

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~58 days

Total

4

Last Release

3184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82691386c8503584a388af7b6c1f716e07518fb2764ccb036c5c4b341f1dd26c?d=identicon)[damiencriado](/maintainers/damiencriado)

---

Tags

databaseenvherokularavelmysqlpostgresqlredislaraveldatabaseredisenvheroku

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itsdamien-laravel-heroku-config-parser/health.svg)

```
[![Health](https://phpackages.com/badges/itsdamien-laravel-heroku-config-parser/health.svg)](https://phpackages.com/packages/itsdamien-laravel-heroku-config-parser)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
