PHPackages                             rootinc/laravel-db-url - 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. rootinc/laravel-db-url

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

rootinc/laravel-db-url
======================

Translates a database URL into Laravel database driver values.

v2.0.1(6y ago)3912MITPHPPHP ^7.1.3

Since Mar 27Pushed 6y agoCompare

[ Source](https://github.com/rootinc/laravel-db-url)[ Packagist](https://packagist.org/packages/rootinc/laravel-db-url)[ RSS](/packages/rootinc-laravel-db-url/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

Laravel Database URL
====================

[](#laravel-database-url)

Drop-in package to translate a database URL into database config values. No more need to add logic to your `config/database.php` file.

This is meant to help prevent the need for manually parsing database URLs, like the ones that come from Heroku or AWS. It will take a URL and assign host, password, username, port, (etc.) components to the default driver or specific driver(s) of your choosing.

This **will override**, at runtime, any `default` database connection values for `host`, `port`, `username`, `password`, and `database`

> Laravel 5.8+ supports Database URL config officially. See [Laravel Database Config](https://laravel.com/docs/5.8/database#configuration).

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1.3
- Laravel 5.6 or 5.7

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

[](#installation)

`$ composer require rootinc/laravel-db-url`

Configuration
-------------

[](#configuration)

The package will automatically map the parsed values from the environment variable `DATABASE_URL` to the `default` database connection.

Add a `DATABASE_URL` entry to your `.env` or server environment with a URL to your default database. `DATABASE_URL=postgresql://username:password@localhost:5432/database-name`

This will overwrite database connection values for `host`, `port`, `username`, `password`, and `database`

Customization
-------------

[](#customization)

Override default behaviour by publishing the config file and setting values.

`$ php artisan vendor:publish --tag=db-url`

Set any database connections by supplying `default` or the key path, like `connections.pgsql`, or `redis`to have a URL mapped onto the connection at that key path.

config/db-url.php

```
return [
  'default' => 'SOME_DATABASE_URL', // "default" resolves key path from default key
  'connections.pgsql' => 'OTHER_PGSQL_URL', // Set the "pgsql" driver with different URL. Same when "default" set to "pgsql"
  'connections.mysql' => 'OTHER_MYSQL_URL', // Set the "mysql" driver with different URL
];

```

.env

```
DATABASE_URL=postgresql://username:password@localhost:5432/database-name
OTHER_MYSQL_URL=mysql://username:password@localhost:3306/db_example

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

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 ~133 days

Total

4

Last Release

2204d ago

Major Versions

v0.1.0 → v1.0.02019-03-28

v1.0.0 → v2.0.02019-04-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fe66b3df7bb4090c31ea71998f6a61bf4e66c3a19dde5097dc875897c3083b2?d=identicon)[djewett](/maintainers/djewett)

![](https://www.gravatar.com/avatar/d8caa53bec7ea671561c5212c03d5ec40567c6e462ae9da821f249528a687901?d=identicon)[jrosenberg](/maintainers/jrosenberg)

---

Top Contributors

[![jaredrhodes](https://avatars.githubusercontent.com/u/1612737?v=4)](https://github.com/jaredrhodes "jaredrhodes (2 commits)")[![lucasMesquitaBorges](https://avatars.githubusercontent.com/u/42281497?v=4)](https://github.com/lucasMesquitaBorges "lucasMesquitaBorges (2 commits)")

---

Tags

phplaraveldatabaseenv

### Embed Badge

![Health badge](/badges/rootinc-laravel-db-url/health.svg)

```
[![Health](https://phpackages.com/badges/rootinc-laravel-db-url/health.svg)](https://phpackages.com/packages/rootinc-laravel-db-url)
```

###  Alternatives

[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[codewithkyrian/chromadb-laravel

ChromaDB Laravel is a Laravel client for the Chroma Open Source Embedding Database

144.1k](/packages/codewithkyrian-chromadb-laravel)

PHPackages © 2026

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