protected function startEventsPlugin($app)
    {
        $this->onRegister('events', function ($app) {
            $events = $this->app->make(Dispatcher::class);

            foreach ($this->events() as $event => $listeners) {
                foreach ($listeners as $listener) {
                    $events->listen($event, $listener);
                }
            }
//        })
//        $this->onBoot('events', function ($app) {
//            $events = $this->app->make('events');

            foreach ($this->listens() as $event => $listeners) {
                foreach ($listeners as $listener) {
                    $events->listen($event, $listener);
                }
            }

            foreach ($this->subscribe as $subscriber) {
                $events->subscribe($subscriber);
            }
        });
    }