hiddenLabel(); $this->iconButton(); $this->iconSize(IconSize::ExtraLarge); $this->icon('tabler-download'); $this->tooltip(trans('server/schedule.export')); /** @var Server $server */ $server = Filament::getTenant(); $this->label(trans('filament-actions::export.modal.actions.export.label')); $this->authorize(fn () => user()?->can(Permission::ACTION_SCHEDULE_READ, $server)); $this->action(fn (ScheduleExporterService $service, Schedule $schedule) => response()->streamDownload(function () use ($service, $schedule) { echo $service->handle($schedule); }, 'schedule-' . str($schedule->name)->kebab()->lower()->trim() . '.json', [ 'Content-Type' => 'application/json', ])); } }