mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
1393179160
* Performance improvements for seeding * Differentiating between system notification and user notifications * Remove hard coded webhook url * Working on system and user notifications * notifications * Set the currency on client if blank * Refactor for inserting invoice defaults * Refactor Default Invoice/Quote/Credit objects * working on credits * Implement mark_sent for quotes and credits
58 lines
1.0 KiB
PHP
58 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Libraries\MultiDB;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class MultiDBProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
if($this->app->runningInConsole()){
|
|
return;
|
|
}
|
|
|
|
|
|
$this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function($event) {
|
|
|
|
if (isset($event->job->payload()['db'])) {
|
|
|
|
\Log::error("Provider Setting DB = ".$event->job->payload()['db']);
|
|
|
|
MultiDB::setDb($event->job->payload()['db']);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
}
|