code: public function register(Container $pimple)
      {
          $pimple['oauth'] = function ($pimple) {
              $callback = $this->prepareCallbackUrl($pimple);
              $scopes = $pimple['config']->get('oauth.scopes', []);
              $socialite = (new Socialite(
                  [
                      'wechat' => [
                          'client_id' => $pimple['config']['app_id'],
                          'client_secret' => $pimple['config']['secret'],
                          'redirect' => $callback,
                      ],
                  ]
              ))->driver('wechat');
  
              if (!empty($scopes)) {
                  $socialite->scopes($scopes);
              }
  
              return $socialite;
          };
      }
docs: Registers services on the given container.
  
  This method should only be used to configure services and parameters.
  It should not get services.
  
  @param Container $pimple A container instance