Update (fix) search
This commit is contained in:
@@ -56,7 +56,7 @@ public function render($request, Throwable $exception)
|
||||
} elseif ($exception instanceof AuthenticationException) {
|
||||
|
||||
} else {
|
||||
inspector()->reportException($exception);
|
||||
//inspector()->reportException($exception);
|
||||
}
|
||||
|
||||
//default laravel response
|
||||
|
||||
@@ -34,12 +34,13 @@ public function search(Request $request)
|
||||
|
||||
// Use full-text search capabilities of your database
|
||||
// For example, using MySQL's full-text search with MATCH...AGAINST
|
||||
$posts = Post::with('category')
|
||||
->where('status', 'publish')
|
||||
->whereRaw("to_tsvector('english', title || ' ' || bites) @@ to_tsquery('english', ?)", [$query])
|
||||
->where('published_at', '<=', now())
|
||||
->orderBy('published_at', 'desc')
|
||||
->cursorPaginate(10);
|
||||
$posts = Post::with('category')
|
||||
->where('status', 'publish')
|
||||
->whereRaw("to_tsvector('english', title || ' ' || bites) @@ to_tsquery('english', ?)", [str_replace(' ', ' & ', $query)])
|
||||
->where('published_at', '<=', now())
|
||||
->orderBy('published_at', 'desc')
|
||||
->cursorPaginate(10);
|
||||
|
||||
|
||||
// breadcrumb json ld
|
||||
$listItems = [];
|
||||
|
||||
Reference in New Issue
Block a user