*/ protected array $publishedAssets = []; public function handle(): int { foreach (FilamentAsset::getAlpineComponents() as $asset) { if ($asset->isRemote()) { continue; } $this->copyAsset($asset->getPath(), $asset->getPublicPath()); } foreach (FilamentAsset::getScripts() as $asset) { if ($asset->isRemote()) { continue; } $this->copyAsset($asset->getPath(), $asset->getPublicPath()); } foreach (FilamentAsset::getStyles() as $asset) { if ($asset->isRemote()) { continue; } $this->copyAsset($asset->getPath(), $asset->getPublicPath()); } foreach (FilamentAsset::getThemes() as $asset) { if ($asset->isRemote()) { continue; } $this->copyAsset($asset->getPath(), $asset->getPublicPath()); } $this->components->bulletList($this->publishedAssets); $this->components->info('Successfully published assets!'); return static::SUCCESS; } protected function copyAsset(string $from, string $to): void { $filesystem = app(Filesystem::class); [$from, $to] = str_replace('/', DIRECTORY_SEPARATOR, [$from, $to]); $filesystem->ensureDirectoryExists( (string) str($to) ->beforeLast(DIRECTORY_SEPARATOR), ); $filesystem->copy($from, $to); $this->publishedAssets[] = $to; } }