laravel/framework — pull request #5352 by crynobone (2014-08-06 05:33:18+00:00)
Title: Add ability to automatically resolve DB::connection('mysql::write') to use writable database connection as well as DB::connection('mysql::read') instead of adding duplicate connection config.

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A

## Current Behaviour

You are required to create separate database configuration if you need to force using either "read" or "write" mode as suggested in .

## Proposed Behaviour

```php
DB::connection('mysql::write')->table('user')->get();
User::on('mysql::write')->get();
```

Both above code should force using "write" pdo connection.

## Limitation

* Depending on the use case, this could actually increase your database connection count as separate PDO connection is created for "mysql" and "mysql::write" connection name.

Signed-off-by: crynobone