diff --git a/app/Filters/PaymentFilters.php b/app/Filters/PaymentFilters.php index c98cb9bd43..8df7cd192f 100644 --- a/app/Filters/PaymentFilters.php +++ b/app/Filters/PaymentFilters.php @@ -72,10 +72,11 @@ class PaymentFilters extends QueryFilters { $sort_col = explode('|', $sort); - if(is_array($sort_col)) - return $this->builder->orderBy($sort_col[0], $sort_col[1]); + if (!is_array($sort_col) || count($sort_col) != 2) { + return $this->builder; + } - return true; + return $this->builder->orderBy($sort_col[0], $sort_col[1]); } public function number(string $number = ''): Builder