where('thumbnail_path', 'like', 'vorschau/%') ->pluck('thumbnail_path') ->each(function (mixed $path) use (&$paths): void { if (is_string($path)) { $paths[$path] = true; } }); } $missing = array_values(array_filter( array_keys($paths), fn (string $path): bool => ! str_contains($path, '..') && ! $derived->exists(ImageVariants::path($path, 'klein')) && $derived->exists($path), )); $websiteIds = ContentElement::query() ->where('output_class', 'bild') ->whereNotNull('website_released_at') ->whereNotNull('website_public_path') ->pluck('id') ->all(); $this->info(count($missing).' Vorschaubilder ohne Fassungen, '.count($websiteIds).' freigegebene Website-Bilder.'); if ($this->option('pretend')) { return self::SUCCESS; } foreach ($missing as $path) { $this->option('now') ? DeriveImageVariants::dispatchSync($path) : DeriveImageVariants::dispatch($path); } foreach ($websiteIds as $id) { $this->option('now') ? DeriveWebsiteVariants::dispatchSync((int) $id) : DeriveWebsiteVariants::dispatch((int) $id); } $this->info($this->option('now') ? 'Fassungen angelegt.' : 'In die Warteschlange gelegt.'); return self::SUCCESS; } }