Register listeners

@param  Illuminate\Events\Dispatcher  $events
494526
public function subscribe(Dispatcher $events)
    {
        foreach ($this->listeners as $name => $handler)
        {
            $events->listen($name, $this->className.'@'.$handler);
        }
    }
708902
public function boot(DispatcherContract $events)
    {
        if (method_exists('Illuminate\\Support\\ServiceProvider', 'boot')) {
            parent::boot($events);
        }

        // Publish the database migrations
        $this->publishes([
            __DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'
        ], 'migrations');
        $this->publishes([
            __DIR__ . '/../config' => config_path()
        ], 'config');
    }
552547
public function attach(EventManagerInterface $events)
    {
        $this->listeners[] = $events->attach(
            ComposerEvent::EVENT_HEADERS_POST,
            array($this, 'injectOverrideHeaders'),
            -100 // The priority needs to be lower than the other plugins
        );
    }
759159
public function setEventClasses($events)
    {
        foreach ($events as $iface => $cls) {
            $this->setEventClass($iface, $cls);
        }
    }
256005
public function attach( EventManagerInterface $events )
    {
        $this->listeners[] = $events->attach(
            MvcEvent::EVENT_DISPATCH_ERROR,
            array( $this, 'setMiddleLayoutToViewModel' ),
            -200
        );
    }
17743
public function subscribe($events)
    {
        $events->listen(
            Authenticated::class,
            'Laranix\Auth\Events\Login\Subscriber@onAuthenticated'
        );

        $events->listen(
            Login::class,
            'Laranix\Auth\Events\Login\Subscriber@onLogin'
        );

        $events->listen(
            Failed::class,
            'Laranix\Auth\Events\Login\Subscriber@onFailed'
        );

        $events->listen(
            Lockout::class,
            'Laranix\Auth\Events\Login\Subscriber@onLockout'
        );

        $events->listen(
            Restricted::class,
            'Laranix\Auth\Events\Login\Subscriber@onLoginRestricted'
        );
    }
1274844
public function registerEvents($events)
    {
        if (empty($events)) {
            throw new \RuntimeException(sprintf('Empty argument passed %s', __FUNCTION__));
        }

        foreach ($events as $event => $namespace) {
            $parts = explode('@', $namespace);
            // attach all before and after event to handler
            $this->register("$event.before", $parts[0].'@before'.ucfirst(Inflector::pathAction(end($parts))))
                 ->register("$event", $parts[0].'@'.Inflector::pathAction(end($parts)))
                 ->register("$event.after", $parts[0].'@after'.ucfirst(Inflector::pathAction(end($parts))));
        }
    }
156195
public function attach(EventManagerInterface $events)
    {
        $this->listeners[] = $events->attach('configureService', array($this, 'handleExcludeAnnotation'));
        $this->listeners[] = $events->attach('configureService', array($this, 'handleContextAnnotation'));
        $this->listeners[] = $events->attach('configureService', array($this, 'handleExcludePatternAnnotation'));
        $this->listeners[] = $events->attach('configureService', array($this, 'handleVersionAnnotation'));
    }
1050084
public function boot(DispatcherContract $events)
    {
        if (method_exists('Illuminate\\Support\\ServiceProvider', 'boot')) {
            parent::boot($events);
        }

        // Publish the database migrations
        $this->publishes([
            __DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'
        ], 'migrations');
        $this->publishes([
            __DIR__ . '/../config' => config_path()
        ], 'config');

        // Log needs a closure as a listener
        Log::listen(function ($level, $message, $context) {
            // Throw out debug messages if we are not in debug mode
            if (($level == 'debug') && (\Config::get('app.debug') != true)) {
                return;
            }

            // Fetch the currently logged in user
            $username = ApplogHelper::currentUserName();

            // Get the list of client IP addresses
            $clientIp = ApplogHelper::getClientIps();

            // Split the log message to see how it is formatted.
            $logdata = explode(':', $message, 6);
            if (count($logdata) == 6) {
                list($classname, $traitname, $filename, $linenumber, $functionname, $message) = $logdata;
            } else {
                list($classname, $traitname, $filename, $linenumber, $functionname, $message) =
                    ['', '', '', '', '', $message];
            }

            // Store the log entry.
            try {
                Applog::create([
                    'type'          => $level,
                    // 'modelname'  => get_class($target),
                    // 'foreign_id' => $target->id,
                    'classname'     => $classname,
                    'traitname'     => $traitname,
                    'filename'      => $filename,
                    'linenumber'    => $linenumber,
                    'functionname'  => $functionname,
                    'message'       => $message,
                    'details'       => json_encode($context),
                    'ipaddr'        => $clientIp,
                    'created_by'    => $username,
                    'updated_by'    => $username,
                ]);
            } catch (\Exception $e) {
                // Do nothing
            }
        });
    }
947685
protected function on($events, $handler)
    {
        $dispatcher = $this->app->make('events');
        $dispatcher->listen($events, $handler);
    }
372186
protected function fire($listeners, $event): void
    {
        ksort($listeners);
        foreach ($listeners as $list) {
            foreach ($list as $listener) {
                $result = $listener($event);
                if (null === $result) {
                    // continue;
                } elseif (false === $result) {
                    break 2;
                } else {
                    $event->setTarget($result);
                }
            }
        }
    }
94596
protected function registerEventListeners()
    {
        foreach ($this->events as $event => $listener) {
            Event::listen($event, $listener);
        }

        return $this;
    }
311104
public function handle(Dispatcher $events)
    {
        $model = $this->argument('model');
        $this->likeType = $this->argument('type');
        $this->service = app(LikeableServiceContract::class);

        if (empty($model)) {
            $this->recountLikesOfAllModelTypes();
        } else {
            $this->recountLikesOfModelType($model);
        }
    }
535657
public function dispatch(array $events)
    {
        foreach ($events as $event) {
            $eventName = $this->getEventName($event);

            $this->app->fireEvent($eventName, $event);
            $this->app->logEvent($eventName .' was fired.');
        }
    }
403877
protected function registerListeners()
    {
        Event::listen(RouteMatched::class, BlockLoad::class);
        Event::listen(GzeroRouteMatched::class, BlockLoad::class);
        Event::listen('block.*', BlockCacheClear::class);
    }
47852
public function listenDispatchEvents(Listener\Dispatch $listener)
    {
        $this->di
                ->get('eventsManager')
                ->attach('dispatch', $listener, PHP_INT_MAX);
        return $this;
    }
662263
public function subscribe(Dispatcher $events)
    {
        $events->listen(PrepareUnserializedSettings::class, [$this, 'addUploadMethods']);
        $events->listen(PrepareApiAttributes::class, [$this, 'prepareApiAttributes']);
    }