From 60ae6b344af8322cfca6f79f20101b0b0b038032 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 30 Jul 2021 21:36:31 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D1=80=D0=B5=D1=88=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=204=20=D0=B1=D1=83=D0=BA=D0=B2=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SearchController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 775ecde..62f3db0 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -26,14 +26,14 @@ class SearchController extends Controller $error = 'В названии разрешены только буквы.'; } } - if (!empty($term) && mb_strlen($term) > 4) { + if (!empty($term) && mb_strlen($term) >= 4) { $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(); } - } elseif (!empty($term) && mb_strlen($term) <= 4) { + } elseif (!empty($term) && mb_strlen($term) < 4) { $error = 'Слишком короткая строка поиска, нужно не менее 4 букв.'; } return view('welcome', [