📜  laravel 显示 slug 发布的类别 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:02.290000             🧑  作者: Mango

代码示例2
Route::get(/category/{slug});

    public function postCategory($slug)
    {
        $posts = Post::where('slug', $slug)->get();

        return view('front.posts.category', compact('posts'));
    }