fix(search): match Arabic ye/kaf with Persian letters in admin search

Customer names stored with ي/ك were missed when typing ی/ک; fold both sides of LIKE.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 21:38:09 +03:30
co-authored by Cursor
parent e27a8ac397
commit cae41e72b8
5 changed files with 57 additions and 17 deletions
+6 -1
View File
@@ -3,6 +3,7 @@
namespace App\DB\Te;
use App\Support\PersianText;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
@@ -37,7 +38,11 @@ class QuerySelector
}
$cols = explode(',', $conf->cols);
if (isset($input['query'])) {
$query = $conf->model::where($cols[0], 'like', '%' . $input['query'] . '%');
$needle = PersianText::likePattern(strtolower((string) $input['query']));
$query = $conf->model::whereRaw(
PersianText::sqlFoldExpr('lower(`'.$cols[0].'`)').' like ?',
[$needle]
);
}