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:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\AppStructure\Tasks;
|
||||
|
||||
use App\Containers\AppStructure\Models\Page;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RegisterApplicationRoutesTask
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$routes = Route::getRoutes();
|
||||
|
||||
foreach ($routes as $route) {
|
||||
if (!Page::where('path', '=', $route->uri)->where('is_registered', '=', true)->exists()) {
|
||||
Page::create([
|
||||
'path' => $route->uri,
|
||||
'is_registered' => true,
|
||||
'is_url' => false,
|
||||
'searchable' => false,
|
||||
'code' => 200,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user