src/Watchers/EventWatcher.php
protected function extractPayload($eventName, $payload)
    {
        if (class_exists($eventName) && isset($payload[0]) && is_object($payload[0])) {
            return ExtractProperties::from($payload[0]);
        }

        return collect($payload)->map(function ($value) {
            return is_object($value) ? [
                'class' => get_class($value),
                'properties' => json_decode(json_encode($value), true),
            ] : $value;
        })->toArray();
    }
protected function extractPayload($eventName, $payload)
    {
        if (class_exists($eventName) && isset($payload[0]) && is_object($payload[0])) {
            return ExtractProperties::from($payload[0]);
        }

        return collect($payload)->map(function ($value) {
            return is_object($value) ? [
                'class' => get_class($value),
                'properties' => json_decode(json_encode($value), true),
            ] : $value;
        })->toArray();
    }
protected function extractPayload ( $ eventName , $ payload ) { if ( class_exists ( $ eventName ) && isset ( $ payload [ 0 ] ) && is_object ( $ payload [ 0 ] ) ) { return ExtractProperties :: from ( $ payload [ 0 ] ) ; } return collect ( $ payload ) -> map ( function ( $ value ) { return is_object ( $ value ) ? [ 'class' => get_class ( $ value ) , 'properties' => json_decode ( json_encode ( $ value ) , true ) , ] : $ value ; } ) -> toArray ( ) ; }
Extract the payload and tags from the event.

@param  string  $eventName
@param  array  $payload
@return array
Extract the payload and tags from the event .