PHPackages                             laralabs/connection-loader - 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. laralabs/connection-loader

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

laralabs/connection-loader
==========================

Load database connections into config from database table

v1.0.0(10y ago)025MITPHPPHP &gt;=5.5.9

Since May 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Laralabs/connection-loader)[ Packagist](https://packagist.org/packages/laralabs/connection-loader)[ RSS](/packages/laralabs-connection-loader/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Connection Loader for Laravel 5
===============================

[](#connection-loader-for-laravel-5)

Have you ever wanted to add database connections from the backend of a Laravel application without the need to edit the configuration files?

Connection Loader for Laravel is a ServiceProvider that loads database connection details from a table in the specified database connection.

You can then access these connections using their name property's with conventional Laravel techniques.

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

[](#installation)

Install via composer by adding the following line to your `composer.json` file:

```
"laralabs/connection-loader": "~1.0.0"
```

After updating composer you will need to add the ServiceProvider to the providers array in `config/app.php`

```
Laralabs\ConnectionLoader\ConnectionLoaderServiceProvider::class,
```

Once you have added this line to your applications configuration file run the following command the publish the config file to `config/connectionloader.php` and migration file to `database/migrations/2016_05_02_000000_create_connection_loader_table.php`:

```
php artisan vendor:publish
```

You should receive confirmation that the files have been copied over from artisan.

Now the database table needs to be created, run the database migration with (this will run using the default connection and with a table name of connection\_loader):

```
php artisan migrate
```

Once the database table has been created the configuration file located at `config/connectionloader.php` needs to be altered, here are it's default values:

```
