protected function loadQueuedServiceProvider($provider, array $options)
    {
        $listeners = (array) Arr::get($options, 'when', []);

        foreach ($listeners as $listen) {
            $this->events->listen($listen, function () use ($provider, $options) {
                $instance = Arr::get($options, 'instance', $provider);

                $this->app->register($instance);
            });
        }
    }