Skip to content

Commit 81e3c85

Browse files
committed
Update where clause
1 parent 8340a7a commit 81e3c85

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Traits/QueryBuilderTrait.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,13 @@ protected function options($parameters)
148148
protected function where(...$parameters)
149149
{
150150
if (count($parameters) < 2 || count($parameters) > 3) {
151-
throw new \Exception('Too many arguments. You can pass minimum 2 and maximum 3 paramneters');
151+
throw new \Exception('You can pass minimum 2 and maximum 3 paramneters');
152152
}
153-
$field = $parameters[0];
153+
$field = strtolower($parameters[0]);
154154
$value = count($parameters) == 3 ? $parameters[2] : $parameters[1];
155155

156156
switch ($field) {
157-
case 'name':
158-
case 'title':
159-
case 'description':
157+
case 'name': case 'title': case 'description':
160158
$this->options['search'] = $value;
161159
break;
162160
default:

0 commit comments

Comments
 (0)