checks(); return view('sys.status.index', [ 'checks' => $checks, 'overall' => HealthProbe::worstStatus($checks), 'environment' => [ 'Version' => config('app.version') ?? 'unbekannt', 'Umgebung' => app()->environment(), 'PHP' => PHP_VERSION, 'Laravel' => app()->version(), 'Queue-Treiber' => config('queue.default'), 'Cache-Treiber' => config('cache.default'), ], 'healthTokenConfigured' => filled(config('monitoring.health.token')), 'horizonAvailable' => config('queue.default') === 'redis', 'failedJobs' => $this->recentFailedJobs(), ]); } /** * @return Collection */ private function recentFailedJobs(): Collection { try { $rows = DB::table('failed_jobs')->latest('failed_at')->limit(10)->get(); } catch (Throwable) { return collect(); } return $rows->map(fn (object $row): array => [ 'uuid' => $row->uuid ?? null, 'job' => json_decode($row->payload, true)['displayName'] ?? 'unbekannt', 'queue' => $row->connection.' / '.$row->queue, 'failed_at' => (string) $row->failed_at, 'error' => Str::limit(Str::before((string) $row->exception, "\n"), 200), ]); } }