/** * Register an event listener with the dispatcher. * * @param string|array $events * @param mixed $listener * @param int $priority * @return void */public function listen($events, $listener, $priority = 0){// Register an event listener use dispathcer foreach ((array) $events as $event) {// loop this events as event if (Str::contains($event, '*')) {// determine this string is has this * char $this->setupWildcardListen($event, $listener);// if has this *, setup the wildcard listen } else {// ele $this->listeners[$event][$priority][] = $this->makeListener($listener);// make listener to event// this listener unset($this->sorted[$event]); // unset event } }}