b2in/packages/flux-cms/core/routes/web.php
2026-04-10 17:18:17 +02:00

30 lines
1 KiB
PHP

<?php
use FluxCms\Core\Http\Controllers\PageController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Flux CMS Frontend Routes
|--------------------------------------------------------------------------
|
| These routes handle the frontend display of CMS content. They should be
| placed at the END of your routes/web.php file to avoid conflicts.
|
*/
// SEO Routes
Route::get('/sitemap.xml', [PageController::class, 'sitemap'])->name('sitemap');
Route::get('/robots.txt', [PageController::class, 'robots'])->name('robots');
// Blog Routes (if using blog functionality)
Route::prefix('blog')->name('blog.')->group(function () {
Route::get('/', [PageController::class, 'blogIndex'])->name('index');
Route::get('/{slug}', [PageController::class, 'blogPost'])->name('show');
});
// CMS Pages - MUST BE LAST!
// This catch-all route should be placed at the very end of your routes file
Route::get('/{slug?}', [PageController::class, 'show'])
->where('slug', '.*')
->name('cms.page');