/home/techb158/ileadtechnology.com/SSM/vendor/laravel/telescope/src/Watchers
NameSizeModeActions
CacheWatcher.php33810644editdlrm
CommandWatcher.php14940644editdlrm
DumpWatcher.php16310644editdlrm
EventWatcher.php44460644editdlrm
ExceptionWatcher.php21960644editdlrm
FetchesStackTrace.php9510644editdlrm
FormatsClosure.php5750644editdlrm
GateWatcher.php20340644editdlrm
JobWatcher.php44240644editdlrm
LogWatcher.php16230644editdlrm
MailWatcher.php26000644editdlrm
ModelWatcher.php16960644editdlrm
NotificationWatcher.php23930644editdlrm
QueryWatcher.php30700644editdlrm
RedisWatcher.php22590644editdlrm
RequestWatcher.php64240644editdlrm
ScheduleWatcher.php21190644editdlrm
ViewWatcher.php49740644editdlrm
Watcher.php5760644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/vendor/laravel/telescope/src/Watchers/EventWatcher.php (4446B)
listen('*', [$this, 'recordEvent']); } /** * Record an event was fired. * * @param string $eventName * @param array $payload * @return void */ public function recordEvent($eventName, $payload) { if (! Telescope::isRecording() || $this->shouldIgnore($eventName)) { return; } $formattedPayload = $this->extractPayload($eventName, $payload); Telescope::recordEvent(IncomingEntry::make([ 'name' => $eventName, 'payload' => empty($formattedPayload) ? null : $formattedPayload, 'listeners' => $this->formatListeners($eventName), 'broadcast' => class_exists($eventName) ? in_array(ShouldBroadcast::class, (array) class_implements($eventName)) : false, ])->tags(class_exists($eventName) && isset($payload[0]) ? ExtractTags::from($payload[0]) : [])); } /** * Extract the payload and tags from the event. * * @param string $eventName * @param array $payload * @return array */ 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(); } /** * Format list of event listeners. * * @param string $eventName * @return array */ protected function formatListeners($eventName) { return collect(app('events')->getListeners($eventName)) ->map(function ($listener) { $listener = (new ReflectionFunction($listener)) ->getStaticVariables()['listener']; if (is_string($listener)) { return Str::contains($listener, '@') ? $listener : $listener.'@handle'; } elseif (is_array($listener)) { return get_class($listener[0]).'@'.$listener[1]; } return $this->formatClosureListener($listener); })->reject(function ($listener) { return Str::contains($listener, 'Laravel\\Telescope'); })->map(function ($listener) { if (Str::contains($listener, '@')) { $queued = in_array(ShouldQueue::class, class_implements(explode('@', $listener)[0])); } return [ 'name' => $listener, 'queued' => $queued ?? false, ]; })->values()->toArray(); } /** * Determine if the event should be ignored. * * @param string $eventName * @return bool */ protected function shouldIgnore($eventName) { return $this->eventIsIgnored($eventName) || (Telescope::$ignoreFrameworkEvents && $this->eventIsFiredByTheFramework($eventName)); } /** * Determine if the event was fired internally by Laravel. * * @param string $eventName * @return bool */ protected function eventIsFiredByTheFramework($eventName) { return Str::is( ['Illuminate\*', 'eloquent*', 'bootstrapped*', 'bootstrapping*', 'creating*', 'composing*'], $eventName ); } /** * Determine if the event is ignored manually. * * @param string $eventName * @return bool */ protected function eventIsIgnored($eventName) { return Str::is($this->options['ignore'] ?? [], $eventName); } }