mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Multi-db support
This commit is contained in:
parent
03bb75674b
commit
3988b6750b
@ -23,6 +23,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
|
// support selecting job database
|
||||||
Queue::before(function (JobProcessing $event) {
|
Queue::before(function (JobProcessing $event) {
|
||||||
$body = $event->job->getRawBody();
|
$body = $event->job->getRawBody();
|
||||||
preg_match('/db-ninja-[\d+]/', $body, $matches);
|
preg_match('/db-ninja-[\d+]/', $body, $matches);
|
||||||
@ -30,7 +31,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
config(['database.default' => $matches[0]]);
|
config(['database.default' => $matches[0]]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Form::macro('image_data', function ($image, $contents = false) {
|
Form::macro('image_data', function ($image, $contents = false) {
|
||||||
if (! $contents) {
|
if (! $contents) {
|
||||||
$contents = file_get_contents($image);
|
$contents = file_get_contents($image);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user