{"id":20349401,"url":"https://github.com/rootinc/laravel-db-url","last_synced_at":"2025-04-12T01:23:32.678Z","repository":{"id":62537303,"uuid":"177869523","full_name":"rootinc/laravel-db-url","owner":"rootinc","description":"Package to translate a database URI into database config values.","archived":false,"fork":false,"pushed_at":"2020-04-30T18:58:23.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T21:11:13.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T21:13:21.000Z","updated_at":"2020-11-19T05:59:17.000Z","dependencies_parsed_at":"2022-11-02T15:00:57.203Z","dependency_job_id":null,"html_url":"https://github.com/rootinc/laravel-db-url","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Flaravel-db-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Flaravel-db-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Flaravel-db-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Flaravel-db-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootinc","download_url":"https://codeload.github.com/rootinc/laravel-db-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358579,"owners_count":21090403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T22:25:46.703Z","updated_at":"2025-04-12T01:23:32.650Z","avatar_url":"https://github.com/rootinc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Database URL\nDrop-in package to translate a database URL into database config values. No more need to add logic to your\n`config/database.php` file.\n\nThis is meant to help prevent the need for manually parsing database URLs, like the ones that come from Heroku or AWS.\nIt will take a URL and assign host, password, username, port, (etc.) components to the default driver or\nspecific driver(s) of your choosing.\n\nThis __will override__, at runtime, any `default` database connection values for `host`, `port`, `username`, `password`, and `database`\n\n\u003e Laravel 5.8+ supports Database URL config officially. See [Laravel Database Config](https://laravel.com/docs/5.8/database#configuration).\n\n## Requirements\n- PHP \u003e= 7.1.3\n- Laravel 5.6 or 5.7\n\n## Installation\n`$ composer require rootinc/laravel-db-url`\n\n## Configuration\nThe package will automatically map the parsed values from the environment variable `DATABASE_URL` to the `default` database connection.\n\nAdd a `DATABASE_URL` entry to your `.env` or server environment with a URL to your default database.\n`DATABASE_URL=postgresql://username:password@localhost:5432/database-name`\n\nThis will overwrite database connection values for `host`, `port`, `username`, `password`, and `database`\n\n\n## Customization\nOverride default behaviour by publishing the config file and setting values.\n\n`$ php artisan vendor:publish --tag=db-url`\n\nSet any database connections by supplying `default` or the key path, like `connections.pgsql`, or `redis`\nto have a URL mapped onto the connection at that key path.\n\nconfig/db-url.php\n```\nreturn [\n  'default' =\u003e 'SOME_DATABASE_URL', // \"default\" resolves key path from default key\n  'connections.pgsql' =\u003e 'OTHER_PGSQL_URL', // Set the \"pgsql\" driver with different URL. Same when \"default\" set to \"pgsql\"\n  'connections.mysql' =\u003e 'OTHER_MYSQL_URL', // Set the \"mysql\" driver with different URL\n];\n```\n.env\n```\nDATABASE_URL=postgresql://username:password@localhost:5432/database-name\nOTHER_MYSQL_URL=mysql://username:password@localhost:3306/db_example\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootinc%2Flaravel-db-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootinc%2Flaravel-db-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootinc%2Flaravel-db-url/lists"}