/home/techb158/ileadtechnology.com/SSM/vendor/laravel/telescope/src/Watchers
Edit: /home/techb158/ileadtechnology.com/SSM/vendor/laravel/telescope/src/Watchers/ScheduleWatcher.php (2119B)
listen(CommandStarting::class, [$this, 'recordCommand']);
}
/**
* Record a scheduled command was executed.
*
* @param \Illuminate\Console\Events\CommandStarting $event
* @return void
*/
public function recordCommand(CommandStarting $event)
{
if (! Telescope::isRecording() ||
$event->command !== 'schedule:run' &&
$event->command !== 'schedule:finish') {
return;
}
collect(app(Schedule::class)->events())->each(function ($event) {
$event->then(function () use ($event) {
Telescope::recordScheduledCommand(IncomingEntry::make([
'command' => $event instanceof CallbackEvent ? 'Closure' : $event->command,
'description' => $event->description,
'expression' => $event->expression,
'timezone' => $event->timezone,
'user' => $event->user,
'output' => $this->getEventOutput($event),
]));
});
});
}
/**
* Get the output for the scheduled event.
*
* @param \Illuminate\Console\Scheduling\Event $event
* @return string|null
*/
protected function getEventOutput(Event $event)
{
if (! $event->output ||
$event->output === $event->getDefaultOutput() ||
$event->shouldAppendOutput ||
! file_exists($event->output)) {
return '';
}
return trim(file_get_contents($event->output));
}
}