convert the query string to lower case

This commit is contained in:
Rev 2021-10-10 13:08:50 +09:00
parent a2be16fe79
commit a187ae011c

View File

@ -25,9 +25,10 @@ class ItemsCollection
* @param string $query
* @return array
*/
public function findItem(string $query)
public function findItem(string $query): array
{
return $this->data->filter(function ($val) use ($query) {
$query = Str::lower($query);
return Str::contains($val['_id'], $query)
|| Str::contains($val['_name'], $query)
|| Str::contains($val['_parent'], $query);