src/B2BApiServiceProvider.php
protected function registerClientInstance()
    {
        $this->app->singleton(B2BApiService::class, function (Container $app) {
            /** @var ConfigRepository $config */
            $config = $app->make('config');

            $client = new B2BApiService($app, $config->get(static::getConfigRootKeyName()));

            // "Вешаем" на события внутри клиента Laravel-обработчики
            $client->client()->httpClient()->on('before_request',
                function (&$method, &$uri, &$data, &$headers) {
                    event(new BeforeRequestSending($method, $uri, $data, $headers));
                }
            );
            $client->client()->httpClient()->on('after_request',
                function (ResponseInterface $response) {
                    event(new AfterRequestSending(clone $response));
                }
            );

            return $client;
        });

        $this->app->bind('b2b-api.service', B2BApiService::class);
    }
protected function registerClientInstance()
    {
        $this->app->singleton(B2BApiService::class, function (Container $app) {
            /** @var ConfigRepository $config */
            $config = $app->make('config');

            $client = new B2BApiService($app, $config->get(static::getConfigRootKeyName()));

            // "Вешаем" на события внутри клиента Laravel-обработчики
            $client->client()->httpClient()->on('before_request',
                function (&$method, &$uri, &$data, &$headers) {
                    event(new BeforeRequestSending($method, $uri, $data, $headers));
                }
            );
            $client->client()->httpClient()->on('after_request',
                function (ResponseInterface $response) {
                    event(new AfterRequestSending(clone $response));
                }
            );

            return $client;
        });

        $this->app->bind('b2b-api.service', B2BApiService::class);
    }
protected function registerClientInstance ( ) { $ this -> app -> singleton ( B2BApiService :: class , function ( Container $ app ) { /** @var ConfigRepository $config */ $ config = $ app -> make ( 'config' ) ; $ client = new B2BApiService ( $ app , $ config -> get ( static :: getConfigRootKeyName ( ) ) ) ; // "Вешаем" на события внутри клиента Laravel-обработчики $ client -> client ( ) -> httpClient ( ) -> on ( 'before_request' , function ( & $ method , & $ uri , & $ data , & $ headers ) { event ( new BeforeRequestSending ( $ method , $ uri , $ data , $ headers ) ) ; } ) ; $ client -> client ( ) -> httpClient ( ) -> on ( 'after_request' , function ( ResponseInterface $ response ) { event ( new AfterRequestSending ( clone $ response ) ) ; } ) ; return $ client ; } ) ; $ this -> app -> bind ( 'b2b-api.service' , B2BApiService :: class ) ; }
Регистрирует контейнер-реализацию клиента.

@return void
Регистрирует контейнер - реализацию клиента .