user()?->can('updates.manage') ?? false; } protected static ?string $slug = 'systemzustand'; protected function getHeaderActions(): array { return [ Action::make('log')->label('Fehlerprotokoll herunterladen')->icon(Heroicon::OutlinedArrowDownTray)->color('gray') ->visible(fn () => app(ErrorLog::class)->latestFile() !== null) ->action(fn () => response()->streamDownload(function () { echo app(ErrorLog::class)->tail((string) app(ErrorLog::class)->latestFile(), 2 * 1_048_576); }, 'fehlerprotokoll-'.now()->format('Y-m-d-His').'.log', ['Content-Type' => 'text/plain; charset=UTF-8'])), ]; } /** * @return array */ protected function getViewData(): array { return [ 'groups' => app(SiteHealth::class)->all(), 'cronLine' => '* * * * * cd '.base_path().' && php artisan schedule:run >> /dev/null 2>&1', 'webCronUrl' => url('/cron/'.app(BackgroundTasks::class)->webCronToken()), 'logErrors' => app(ErrorLog::class)->recent(), ]; } }