1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Middleware/SetWebDb.php
2019-09-24 08:37:38 +10:00

31 lines
503 B
PHP

<?php
namespace App\Http\Middleware;
use App\Libraries\MultiDB;
use Closure;
use Cookie;
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'))
{
MultiDB::setDB(Cookie::get('db'));
}
return $next($request);
}
}