refactor sitemap generation and navigation handling; remove old GenerateSitemap command, update to use tasks for better organization, and enhance navigation data retrieval

This commit is contained in:
F4ilji
2025-07-18 13:07:51 +05:00
parent 1257cd552c
commit 0874d3e6b5
28 changed files with 461 additions and 475 deletions
@@ -0,0 +1,25 @@
<?php
namespace App\Containers\AppStructure\Tasks;
class GetIndexRouteNameTask
{
public function run(string $routeName = null): ?string
{
if ($routeName === null) {
return null;
}
$parts = explode('.', $routeName);
// Если в маршруте нет точек или он уже заканчивается на index
if (count($parts) <= 1 || end($parts) === 'index') {
return $routeName;
}
// Заменяем последнюю часть на index
$parts[count($parts) - 1] = 'index';
return implode('.', $parts);
}
}