Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
467 B
PHP
22 lines
467 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Blog\Controllers;
|
|
|
|
use App\Models\Category;
|
|
|
|
class CategoryController extends Controller
|
|
{
|
|
public function show(string $slug)
|
|
{
|
|
$category = Category::query()->where('slug', $slug)->orWhere('id', (int) $slug)->firstOrFail();
|
|
|
|
$posts = blog_paginate(
|
|
$category->posts()->published()->orderedForList()
|
|
);
|
|
|
|
return theme_view('list', compact('category', 'posts'));
|
|
}
|
|
}
|