<?php

use App\Http\Controllers\BlogController;
use Illuminate\Support\Facades\Route;

// Livewire 静态资源路由 (修复 404 问题)
Route::get('/livewire/livewire.js', function () {
    return response()->file(public_path('vendor/livewire/livewire.min.js'), [
        'Content-Type' => 'application/javascript',
    ]);
});

// 博客首页
Route::get('/', [BlogController::class, 'index'])->name('home');

// 搜索
Route::get('/search', [BlogController::class, 'search'])->name('search');

// 分类文章
Route::get('/category/{category:slug}', [BlogController::class, 'category'])->name('category');

// 标签文章
Route::get('/tag/{tag:slug}', [BlogController::class, 'tag'])->name('tag');

// 文章详情
Route::get('/post/{post:slug}', [BlogController::class, 'show'])->name('post.show');
