some progress

This commit is contained in:
Doar Mihai
2026-01-24 12:16:10 +02:00
parent 3665a1d5a3
commit 612cc097f8
51 changed files with 8089 additions and 470 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace App\Console\Commands;
use App\Jobs\CheckSitemap;
use App\Models\Sitemap;
use Illuminate\Console\Command;
class MonitorSitemaps extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'monitor:sitemaps';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all active sitemaps for validity and accessibility';
/**
* Execute the console command.
*/
public function handle()
{
$this->info('Starting sitemap monitoring...');
$sitemaps = Sitemap::where('is_active', true)->get();
if ($sitemaps->isEmpty()) {
$this->warn('No active sitemaps found to monitor.');
return Command::SUCCESS;
}
$this->info("Found {$sitemaps->count()} active sitemap(s) to check.");
$progressBar = $this->output->createProgressBar($sitemaps->count());
$progressBar->start();
foreach ($sitemaps as $sitemap) {
CheckSitemap::dispatch($sitemap);
$progressBar->advance();
}
$progressBar->finish();
$this->newLine();
$this->info('Sitemap check jobs have been dispatched.');
return Command::SUCCESS;
}
}