code: public function config(Request $request)
      {
          if ($key = $request->query('key')) {
              /** @see Config::get() */
              return \config($key);
          }
  
          /** @see Config::toArray() */
          return \bean('config')->toArray();
      }
docs: Get app config
  @RequestMapping(route="config", method=RequestMethod::GET)
  @param Request $request
  @return array|mixed
  @throws \Throwable