feat: extend rate card profiles with brands, terms, and custom HTML, and remove search bar from search index view
This commit is contained in:
@@ -17,7 +17,7 @@ class SearchController extends Controller
|
||||
{
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$q = trim($request->get('q', ''));
|
||||
$q = trim((string) $request->get('q', ''));
|
||||
$results = $q ? $this->search($q) : [];
|
||||
|
||||
return view('search.index', compact('q', 'results'));
|
||||
@@ -26,7 +26,7 @@ class SearchController extends Controller
|
||||
/** Quick AJAX endpoint — returns grouped results for the dropdown */
|
||||
public function quick(Request $request): JsonResponse
|
||||
{
|
||||
$q = trim($request->get('q', ''));
|
||||
$q = trim((string) $request->get('q', ''));
|
||||
|
||||
if (strlen($q) < 2) {
|
||||
return response()->json([]);
|
||||
@@ -138,6 +138,24 @@ class SearchController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
// ── Notes ───────────────────────────────────────────
|
||||
$notes = \App\Models\Note::where('title', 'LIKE', $like)
|
||||
->orWhere('content', 'LIKE', $like)
|
||||
->limit($limit)->get();
|
||||
|
||||
if ($notes->isNotEmpty()) {
|
||||
$groups[] = [
|
||||
'type' => 'notes',
|
||||
'label' => '📝 Notes',
|
||||
'items' => $notes->map(fn ($n) => [
|
||||
'icon' => '📝',
|
||||
'title' => $n->title ?: 'Untitled',
|
||||
'subtitle' => 'Notes Management',
|
||||
'url' => route('notes.index'),
|
||||
])->values()->all(),
|
||||
];
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user