Skip to content

Commit f8d40d9

Browse files
committed
Use slug for generating search links
1 parent 87eed68 commit f8d40d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Models/Thread.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function toSearchableArray(): array
220220
return [
221221
'subject' => $this->subject(),
222222
'body' => $this->body(),
223-
'url' => route('thread', $this->slug()),
223+
'slug' => $this->slug(),
224224
];
225225
}
226226
}

resources/views/layouts/_nav.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class="nav-search block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md
8484
<div class="rounded-md bg-white shadow-xs w-full">
8585
<div class="py-1">
8686
<template x-for="result in results" :key="result.subject">
87-
<a :href="result.url" class="block px-4 py-2 text-base leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">
87+
<a :href="'/forum/'+result.slug" class="block px-4 py-2 text-base leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">
8888
<span class="block font-bold" x-html="result._highlightResult.subject.value"></span>
8989
<span class="block text-sm txt-gray-400" x-html="result._snippetResult.body.value"></span>
9090
</a>

0 commit comments

Comments
 (0)