diff --git a/resources/ts/hooks/use-string.tsx b/resources/ts/hooks/use-string.tsx index df25e0b3..57f7cf60 100644 --- a/resources/ts/hooks/use-string.tsx +++ b/resources/ts/hooks/use-string.tsx @@ -20,7 +20,7 @@ interface Stringable { */ slug: () => Stringable; /** - * Pascal case a word based. + * Upper case the first letter of a word based. * Examples: * - some $ in the GARDEN ! -> Some $ in the GARDEN ! * @@ -28,7 +28,7 @@ interface Stringable { */ ucFirst: () => Stringable; /** - * Pascal case a word based. + * Camel case a word based. * Examples: * - Some $ in the GARDEN ! -> some$InTheGarden! * diff --git a/resources/views/components/front/search/content.blade.php b/resources/views/components/front/search/content.blade.php index f249b244..ff8889b6 100644 --- a/resources/views/components/front/search/content.blade.php +++ b/resources/views/components/front/search/content.blade.php @@ -20,6 +20,7 @@ 'terms' => $searchTerm, ]); $currentLocale = app()->getLocale(); + $routeAjax = route('front.searching.ajax.news'); @endphp @push('scripts') @@ -46,7 +47,7 @@ results.innerHTML = ''; pagination.innerHTML = ''; - fetch('/search/load/results', { + fetch(@json($routeAjax), { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/routes/web-front.php b/routes/web-front.php index 1462af97..d9ec6363 100644 --- a/routes/web-front.php +++ b/routes/web-front.php @@ -26,12 +26,11 @@ Route::group( ->where('unsubscribe', 'unsubscribe|unsubscribe.php|unsubscribe.html|newsletter') ->name('unsubscribeNewsletter'); - // Search routes. Route::get(LaravelLocalization::transRoute('routes.front.search'), [SearchController::class, 'search']) ->name('search'); - Route::post('/search/load/results', [SearchController::class, 'ajaxSearchLoadResults']) - ->name('search.ajax.news'); + Route::post('/searching/load/results', [SearchController::class, 'ajaxSearchLoadResults']) + ->name('searching.ajax.news'); // Filters routes. Route::prefix('posts')->group(function () {