mardi 22 septembre 2020

Searching for UTF-8 channels without UTF-8 letters in query

What is the best way to get non-utf8 results when slug contains UTF8 letters? (For example: When I type the slug "Zaidimai", select all from the database where like "Žaidimai" and "Zaidimai").

Current code:

$results = DB::table('channels') -> where([['name', 'like', '%' . $slug . '%'], ['status', '=', 'OK']]) -> orWhere([['slug', 'like', '%' . $slug . '%'], ['status', '=', 'OK']]) -> limit(3) -> get();

It works fine, but when I try to search for a channel by entering "Zaidimai" in the search bar, it doesn't show the channel I want (Žaidimai).



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire