I'm trying to make a search engine for my site. It works unless there are accents in a word.
For example, if I have the title: "Musée Baudouin", if I write "Musee Baudouin" or "Musée Baudouin", it does not display anything. If I write just "Baudouin", it's work.
I can't find my articles if they have accents in the title.
How to do ?
public function searchNav(Request $request)
{
$search = $request->get('search');
$buildings = Building::where('title', 'LIKE', '%' . $search . '%')->orWhere('city', 'LIKE', '%' . $search . '%')->published()->get();
$events = Event::where('title', 'LIKE', '%' . $search . '%')->orWhere('city', 'LIKE', '%' . $search . '%')->published()->get();
// Create a new collection and merge elements
$all = new Collection();
$all = $all->merge($buildings);
$all = $all->merge($events);
$all = $all->sortByDesc('updated_at');
$this->data['items'] = $all->all();
return view('pages.search-nav-results', $this->data);
}
Thanks