route('confirmation_code')); if(!is_array($segments)) return response()->json(['message' => 'Invalid confirmation code'], 403); $hashed_db = $hashids->decode($segments[0]); if(!is_array($hashed_db) || empty($hashed_db)) return response()->json(['message' => 'Invalid confirmation code'], 403); MultiDB::setDB(MultiDB::DB_PREFIX.str_pad($hashed_db[0], 2, '0', STR_PAD_LEFT)); } return $next($request); } }