public function trigger(string $event, array $arguments = null): array
    {
        // The responses
        $responses = [];

        if (! $this->has($event) || ! $this->hasListeners($event)) {
            return $responses;
        }

        // Iterate through all the event's listeners
        foreach ($this->getListeners($event) as $listener) {
            // Attempt to dispatch the event listener using any one of the
            // callable options
            $dispatch = $this->app->dispatcher()->dispatchCallable(
                $listener,
                $arguments
            );

            if (null !== $dispatch) {
                $responses[] = $dispatch;
            }
        }

        return $responses;
    }
public function trigger(string $event, array $arguments = null): array
    {
        // The responses
        $responses = [];

        if (! $this->has($event) || ! $this->hasListeners($event)) {
            return $responses;
        }

        // Iterate through all the event's listeners
        foreach ($this->getListeners($event) as $listener) {
            // Attempt to dispatch the event listener using any one of the
            // callable options
            $dispatch = $this->app->dispatcher()->dispatchCallable(
                $listener,
                $arguments
            );

            if (null !== $dispatch) {
                $responses[] = $dispatch;
            }
        }

        return $responses;
    }
public function trigger ( string $ event , array $ arguments = null ) : array { // The responses $ responses = [ ] ; if ( ! $ this -> has ( $ event ) || ! $ this -> hasListeners ( $ event ) ) { return $ responses ; } // Iterate through all the event's listeners foreach ( $ this -> getListeners ( $ event ) as $ listener ) { // Attempt to dispatch the event listener using any one of the // callable options $ dispatch = $ this -> app -> dispatcher ( ) -> dispatchCallable ( $ listener , $ arguments ) ; if ( null !== $ dispatch ) { $ responses [ ] = $ dispatch ; } } return $ responses ; }
Trigger an event.

@param string $event     The event
@param array  $arguments [optional] The arguments

@return array
Trigger an event .