1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/app/Http/Middleware/SetWebDb.php

27 lines
476 B
PHP
Raw Normal View History

2019-05-22 05:46:42 +02:00
<?php
namespace App\Http\Middleware;
use App\Libraries\MultiDB;
use Closure;
2019-05-22 05:48:25 +02:00
use Cookie;
2019-05-22 05:46:42 +02:00
class SetWebDb
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (config('ninja.db.multi_db_enabled')) {
2019-05-22 05:46:42 +02:00
MultiDB::setDB(Cookie::get('db'));
}
return $next($request);
}
}