Skip to content

Commit

Permalink
Merge pull request #90 from MGHollander/84-fix-search-bug-with-capita…
Browse files Browse the repository at this point in the history
…l-letters

#84 fix search bug with capital letters
  • Loading branch information
MGHollander authored Jun 8, 2024
2 parents f08f772 + 95c1405 commit 1b8fd06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function index(Request $request): Response
$recipes = Search::add(Recipe::class, ['title', 'ingredients', 'instructions', 'tags.name'])
->paginate(15)
->beginWithWildcard()
->search($q)
->search(strtolower($q))
->withQueryString()
->through(fn($recipe) => [
'id' => $recipe->id,
Expand Down
1 change: 0 additions & 1 deletion resources/js/Components/SearchBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { useForm } from "@inertiajs/vue3";
let props = defineProps({
recipes: Object,
q: String,
size: String,
});
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Pages/Search/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ const title =
props.q !== "" && props.recipes.total > 0
? `${props.recipes.total} ${recipeNounForm} met '${props.q}'`
: props.q && props.recipes.total === 0
? `Geen recepten met '${props.q}'`
: "Zoek een recept";
? `Geen recepten met '${props.q}'`
: "Zoek een recept";
</script>
<template>
<Head :title="title" />
<DefaultLayout>
<div class="space-y-6 px-4 sm:space-y-12 sm:px-0">
<SearchBlock size="small" />
<SearchBlock size="small" :q="q" />
<div v-if="recipes.total === 0">
<h1 class="mb-4 text-center text-2xl font-bold">
Expand Down

0 comments on commit 1b8fd06

Please sign in to comment.