Search with 3 characters in products name and 5 charcters in descriptiom
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
2024-01-01 13:35:21 +01:00
parent 73de3a69b9
commit f41e77a3a7
2 changed files with 4 additions and 2 deletions

View File

@@ -26,7 +26,9 @@ class IkeaProducts extends Model
protected function search($item)
{
if (strlen($item) > 3) {
if (strlen($item) >= 3 && 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 {
return [];