When we use f_params[limit]=\d it gives one result only whatever the limit we provide (it act like we have queried f_params[limit]=1) .
Suggested fix below:
public function apply($query): Builder
{
foreach ($this->values as $key => $param) {
if (!in_array($key, self::$reserve_param['f_params'])) {
throw new \Exception("$key is not in f_params array.");
}
if (is_array($param)) {
$this->values['orderBy']['field'] = explode(',', $this->values['orderBy']['field']);
foreach ($this->values['orderBy']['field'] as $order_by) {
$query->orderBy($order_by, $this->values['orderBy']['type']);
}
} else {
$query->limit($param);
}
}
Hello,
When we use f_params[limit]=\d it gives one result only whatever the limit we provide (it act like we have queried f_params[limit]=1) .
Suggested fix below:
public function apply($query): Builder { foreach ($this->values as $key => $param) { if (!in_array($key, self::$reserve_param['f_params'])) { throw new \Exception("$key is not in f_params array."); } if (is_array($param)) { $this->values['orderBy']['field'] = explode(',', $this->values['orderBy']['field']); foreach ($this->values['orderBy']['field'] as $order_by) { $query->orderBy($order_by, $this->values['orderBy']['type']); } } else { $query->limit($param); } }