Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit d207c17

Browse files
authored
Merge pull request #2 from rootinc/develop
Update package name
2 parents 013ccaf + e612684 commit d207c17

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Laravel Database URI
2-
Drop-in package to translate a database URI into database config values. No more need to add logic to your
1+
# Laravel Database URL
2+
Drop-in package to translate a database URL into database config values. No more need to add logic to your
33
`config/database.php` file.
44

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

99
This __will override__, at runtime, any `default` database connection values for `host`, `port`, `username`, `password`, and `database`
@@ -14,12 +14,12 @@ This __will override__, at runtime, any `default` database connection values for
1414
- Laravel >= 5.6
1515

1616
## Installation
17-
`$ composer require rootinc/laravel-db-uri`
17+
`$ composer require rootinc/laravel-db-url`
1818

1919
## Configuration
2020
The package will automatically map the parsed values from the environment variable `DATABASE_URL` to the `default` database connection.
2121

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

2525
This will overwrite database connection values for `host`, `port`, `username`, `password`, and `database`
@@ -28,12 +28,12 @@ This will overwrite database connection values for `host`, `port`, `username`, `
2828
## Customization
2929
Override default behaviour by publishing the config file and setting values.
3030

31-
`$ php artisan vendor:publish --tag=db-uri`
31+
`$ php artisan vendor:publish --tag=db-url`
3232

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

36-
config/db-uri.php
36+
config/db-url.php
3737
```
3838
return [
3939
'default' => 'SOME_DATABASE_URL', // "default" resolves key path from default key

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rootinc/laravel-db-uri",
3-
"description": "Translates a database URI into Laravel database driver values.",
2+
"name": "rootinc/laravel-db-url",
3+
"description": "Translates a database URL into Laravel database driver values.",
44
"keywords": ["php", "laravel", "database", "env"],
55
"type": "library",
66
"require": {
@@ -16,13 +16,13 @@
1616
],
1717
"autoload": {
1818
"psr-4": {
19-
"RootInc\\LaravelDbUri\\": "src/"
19+
"RootInc\\LaravelDbUrl\\": "src/"
2020
}
2121
},
2222
"extra": {
2323
"laravel": {
2424
"providers": [
25-
"RootInc\\LaravelDbUri\\LaravelDbUriServiceProvider"
25+
"RootInc\\LaravelDbUrl\\LaravelDbUrlServiceProvider"
2626
]
2727
}
2828
},

src/LaravelDbUriServiceProvider.php renamed to src/LaravelDbUrlServiceProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Rootinc\LaravelDbUri;
3+
namespace Rootinc\LaravelDbUrl;
44

55
use Illuminate\Support\ServiceProvider;
66

7-
class LaravelDbUriServiceProvider extends ServiceProvider
7+
class LaravelDbUrlServiceProvider extends ServiceProvider
88
{
99

1010
/**
@@ -33,15 +33,15 @@ public function boot()
3333
public function register()
3434
{
3535
$this->publishes([
36-
__DIR__.'/config/db-uri.php' => config_path('db-uri.php')
37-
], 'db-uri');
36+
__DIR__.'/config/db-url.php' => config_path('db-url.php')
37+
], 'db-url');
3838

3939
$this->mergeConfigFrom(
40-
__DIR__.'/config/db-uri.php', 'db-uri'
40+
__DIR__.'/config/db-url.php', 'db-url'
4141
);
4242

4343
// All driver/connection mappings from config
44-
$connections = config('db-uri');
44+
$connections = config('db-url');
4545

4646
// Loop and set each connection
4747
foreach($connections as $driver_path => $connection_key) {
File renamed without changes.

0 commit comments

Comments
 (0)