feat(commands): add GenerateSitemapCommand for sitemap generation

- Added GenerateSitemapCommand to create sitemap.xml
- Updated Kernel to schedule sitemap generation weekly
- Updated composer.json with spatie/laravel-sitemap dependency
This commit is contained in:
Rico van Zelst
2024-02-26 17:48:22 +01:00
parent d7f03d3315
commit c6f9423241
5 changed files with 31598 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Spatie\Sitemap\SitemapGenerator;
class GenerateSitemapCommand extends Command
{
protected $signature = 'sitemap:generate';
protected $description = 'Command description';
public function handle(): void
{
SitemapGenerator::create('https://heimerdinger.lol')
->writeToFile(public_path('sitemap.xml'));
}
}