resolveSourceDirectory(); $targetDir = public_path('flux'); if (! File::isDirectory($targetDir)) { File::makeDirectory($targetDir, 0755, true); } $files = [ 'flux.js', 'flux.min.js', 'editor.js', 'editor.min.js', 'editor.css', ]; $published = 0; foreach ($files as $file) { $source = $sourceDir.'/'.$file; if (! is_file($source)) { continue; } $target = $targetDir.'/'.$file; if (is_file($target) && ! $this->option('force') && hash_file('sha256', $source) === hash_file('sha256', $target)) { $this->line(" • {$file} (unverändert)"); continue; } File::copy($source, $target); $this->line(" ✓ {$file}"); $published++; } if ($published === 0) { $this->info('Flux-Assets sind bereits aktuell.'); return self::SUCCESS; } $this->newLine(); $this->info("{$published} Flux-Asset(s) nach public/flux/ veröffentlicht."); return self::SUCCESS; } private function resolveSourceDirectory(): string { $proDist = base_path('vendor/livewire/flux-pro/dist'); if (is_dir($proDist)) { return $proDist; } $freeDist = base_path('vendor/livewire/flux/dist'); if (is_dir($freeDist)) { return $freeDist; } throw new RuntimeException('Flux vendor assets not found. Run composer install first.'); } }