protected function filterEvents(array $events)
    {
        if (! $eventName = $this->option('event')) {
            return $events;
        }

        return collect($events)->filter(function ($listeners, $event) use ($eventName) {
            return Str::contains($event, $eventName);
        })->toArray();
    }
protected function filterEvents(array $events)
    {
        if (! $eventName = $this->option('event')) {
            return $events;
        }

        return collect($events)->filter(function ($listeners, $event) use ($eventName) {
            return Str::contains($event, $eventName);
        })->toArray();
    }
protected function filterEvents ( array $ events ) { if ( ! $ eventName = $ this -> option ( 'event' ) ) { return $ events ; } return collect ( $ events ) -> filter ( function ( $ listeners , $ event ) use ( $ eventName ) { return Str :: contains ( $ event , $ eventName ) ; } ) -> toArray ( ) ; }
Filter the given events using the provided event name filter.

@param  array  $events
@return array
Filter the given events using the provided event name filter .