Larabros\Elogram\Providers\MiddlewareServiceProvider::register PHP Метод

register() публичный Метод

Use the register method to register items with the container via the protected $this->container property or the getContainer method from the ContainerAwareTrait.
public register ( ) : void
Результат void
    public function register()
    {
        $container = $this->getContainer();
        $config = $container->get('config');
        $container->share(HandlerStack::class, function () {
            return HandlerStack::create();
        });
        // If access token was provided, then instantiate and add to middleware
        if ($config->has('access_token') && $config->get('access_token') !== null) {
            // Convert the JSON serialized token into an `AccessToken` instance.
            $config->set('access_token', new AccessToken(json_decode($config->get('access_token'), true)));
        }
        $this->addMiddleware();
    }
MiddlewareServiceProvider