File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SolutionForest \InspireCms \Commands ;
4+
5+ use Illuminate \Console \Command ;
6+ use Symfony \Component \Console \Attribute \AsCommand ;
7+
8+
9+ #[AsCommand(
10+ name: 'inspirecms:generate-sitemap ' ,
11+ description: 'Generate a sitemap for the InspireCMS plugin '
12+ )]
13+ class GenerateSitemap extends Command
14+ {
15+ public function handle ()
16+ {
17+ $ this ->info ('Generating Sitemap... ' );
18+
19+ // Create the sitemap using the factory
20+ $ sitemapGenerator = \SolutionForest \InspireCms \Factories \SitemapGeneratorFactory::create ();
21+ $ sitemapGenerator ->generateSitemapFile ();
22+
23+ $ this ->info ('Sitemap generated successfully! ' );
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ protected function getCommands(): array
213213 return [
214214 Commands \AboutCommand::class,
215215 Commands \CacheStats::class,
216+ Commands \GenerateSitemap::class,
216217 Commands \UpdatePluginCommand::class,
217218 Commands \PublishPanel::class,
218219 Commands \InstallRequirePacakges::class,
You can’t perform that action at this time.
0 commit comments