search in typename if lengith > 2
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
2024-01-03 18:17:04 +01:00
parent 49c0c94ec9
commit a5c3da9436
2 changed files with 3 additions and 3 deletions

View File

@@ -26,8 +26,8 @@ class IkeaProducts extends Model
protected function search($item)
{
if (strlen($item) >= 3 && strlen($item) <= 5) {
return $this->where('name', 'LIKE', '%' . $item . '%')->get();
if (strlen($item) >= 2 && strlen($item) <= 5) {
return $this->where('name', 'LIKE', $item . '%')->get();
} else if (strlen($item >= 5)) {
return $this->where('typeName', 'LIKE', '%' . $item . '%')->orWhere('name', 'LIKE', '%' . $item . '%')->get();
} else {