Files
laralog/app/Blog/Controllers/SearchController.php
T
goukiandCursor ae47447062
Build and Deploy / verify (push) Successful in 40s
Build and Deploy / deploy (push) Successful in 36s
feat: restore sablog browse modes and clean imported HTML
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>
2026-09-18 21:33:02 +00:00

22 lines
423 B
PHP

<?php
declare(strict_types=1);
namespace App\Blog\Controllers;
use App\Models\Post;
class SearchController extends Controller
{
public function index()
{
$keyword = trim(request('q', request('keyword', '')));
$posts = blog_paginate(
Post::query()->published()->search($keyword)->orderedForList()
);
return theme_view('search', compact('posts', 'keyword'));
}
}