mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
f712b789ca
* fix typo * php-cs traits * CS fixer pass * Password protect User routes * Implement checks to prevent editing a deleted record * Clean up payment flows * Fixes for tests
28 lines
477 B
PHP
28 lines
477 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);
|
|
}
|
|
}
|