mb_strtolower

This commit is contained in:
Alexander Yakovlev 2021-07-30 20:37:33 +07:00
parent 6c59f310cb
commit 0d41ddcd7c
Signed by: oreolek
GPG key ID: 8D24103F5EE2A6C0

View file

@ -27,8 +27,8 @@ class SearchController extends Controller
}
}
if (!empty($term) && mb_strlen($term) > 4) {
$term = strtoupper($term);
$options = Game::where(DB::raw('UPPER(title)'), 'LIKE', '%'.$term.'%')->get();
$term = mb_strtolower($term);
$options = Game::where(DB::raw('LOWER(title)'), 'LIKE', '%'.$term.'%')->get();
if ($options->count() === 1) {
$page = new Wikipage($options[0]);
$response = $page->getContent();