diff --git a/src/Commands/WorkCommand.php b/src/Commands/WorkCommand.php index c59b9602..db3dc9e6 100644 --- a/src/Commands/WorkCommand.php +++ b/src/Commands/WorkCommand.php @@ -55,6 +55,8 @@ public function handle( $lastTrimmedStorageAt = $now; } + $this->ensureTelescopeEntriesAreCollected(); + if ($this->option('stop-when-empty')) { return self::SUCCESS; } @@ -62,4 +64,14 @@ public function handle( Sleep::for(1)->second(); } } + + /** + * Schedule Telescope to store entries if enabled. + */ + protected function ensureTelescopeEntriesAreCollected(): void + { + if ($this->laravel->bound(\Laravel\Telescope\Contracts\EntriesRepository::class)) { + \Laravel\Telescope\Telescope::store($this->laravel->make(\Laravel\Telescope\Contracts\EntriesRepository::class)); + } + } }