Files
ai-nav/web10/routes/web.php

51 lines
2.6 KiB
PHP
Raw Normal View History

2026-02-05 22:22:10 +08:00
<?php
use App\Http\Controllers\ArticleController;
2026-02-07 22:55:07 +08:00
use App\Http\Controllers\AdController;
2026-02-05 22:22:10 +08:00
use App\Http\Controllers\CategoryController;
use App\Http\Controllers\CommentController;
use App\Http\Controllers\ContactController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\OutboundController;
use App\Http\Controllers\PageController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\SearchController;
use App\Http\Controllers\SitemapController;
use App\Http\Controllers\TagController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('/categories', [CategoryController::class, 'index'])->name('categories.index');
Route::get('/category/{slug}', [CategoryController::class, 'show'])->name('categories.show');
Route::get('/tags', [TagController::class, 'index'])->name('tags.index');
Route::get('/tag/{slug}', [TagController::class, 'show'])->name('tags.show');
Route::get('/product/{slug}', [ProductController::class, 'show'])->name('products.show');
Route::get('/articles', [ArticleController::class, 'index'])->name('articles.index');
Route::get('/article/{slug}', [ArticleController::class, 'show'])->name('articles.show');
Route::get('/about', [PageController::class, 'about'])->name('about');
Route::get('/contact', [ContactController::class, 'show'])->name('contact.show');
Route::post('/contact', [ContactController::class, 'store'])->name('contact.store');
Route::get('/search', [SearchController::class, 'index'])->name('search.index');
Route::get('/out/{slug}', [OutboundController::class, 'redirect'])->name('outbound');
2026-02-07 22:55:07 +08:00
Route::get('/ads/{ad}', [AdController::class, 'redirect'])->name('ads.redirect');
2026-02-05 22:22:10 +08:00
Route::post('/comments', [CommentController::class, 'store'])->name('comments.store');
Route::post('/comments/{comment}/like', [CommentController::class, 'like'])->name('comments.like');
Route::get('/captcha', [CommentController::class, 'captcha'])->name('comments.captcha');
Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap');
Route::get('/robots.txt', function () {
$content = "User-agent: *\nDisallow: /admin\nSitemap: " . url('/sitemap.xml');
return response($content, 200)->header('Content-Type', 'text/plain');
});