diff --git a/packages/support/src/SupportServiceProvider.php b/packages/support/src/SupportServiceProvider.php index 4b77da4e52..d584efff8a 100644 --- a/packages/support/src/SupportServiceProvider.php +++ b/packages/support/src/SupportServiceProvider.php @@ -106,34 +106,34 @@ class SupportServiceProvider extends PackageServiceProvider return new Stringable(Str::sanitizeHtml($this->value)); }); + if (class_exists(InstalledVersions::class)) { + $packages = [ + 'filament', + 'forms', + 'notifications', + 'support', + 'tables', + ]; + + AboutCommand::add('Filament', static fn () => [ + 'Version' => InstalledVersions::getPrettyVersion('filament/support'), + 'Packages' => collect($packages) + ->filter(fn (string $package): bool => InstalledVersions::isInstalled("filament/{$package}")) + ->join(', '), + 'Views' => function () use ($packages): string { + $publishedViewPaths = collect($packages) + ->filter(fn (string $package): bool => is_dir(resource_path("views/vendor/{$package}"))); + + if (! $publishedViewPaths->count()) { + return 'NOT PUBLISHED'; + } + + return "PUBLISHED: {$publishedViewPaths->join(', ')}"; + }, + ]); + } + if ($this->app->runningInConsole()) { - if (class_exists(InstalledVersions::class)) { - $packages = [ - 'filament', - 'forms', - 'notifications', - 'support', - 'tables', - ]; - - AboutCommand::add('Filament', static fn () => [ - 'Version' => InstalledVersions::getPrettyVersion('filament/support'), - 'Packages' => collect($packages) - ->filter(fn (string $package): bool => InstalledVersions::isInstalled("filament/{$package}")) - ->join(', '), - 'Views' => function () use ($packages): string { - $publishedViewPaths = collect($packages) - ->filter(fn (string $package): bool => is_dir(resource_path("views/vendor/{$package}"))); - - if (! $publishedViewPaths->count()) { - return 'NOT PUBLISHED'; - } - - return "PUBLISHED: {$publishedViewPaths->join(', ')}"; - }, - ]); - } - $this->publishes([ $this->package->basePath('/../config/filament.php') => config_path('filament.php'), ], 'filament-config');