'Invalid token', 'errors' => new \stdClass ]; /* * Use the host name to set the active DB **/ if ($request->getSchemeAndHttpHost() && config('ninja.db.multi_db_enabled') && ! MultiDB::findAndSetDbByDomain($request->getSchemeAndHttpHost())) { if (request()->json) { return response()->json($error, 403); } else { abort(404); } } return $next($request); } }