From 5832ad92c0543e2ef7fe2f11f534d2fb2058a2d9 Mon Sep 17 00:00:00 2001 From: majid mohammadian Date: Sat, 28 Oct 2023 10:35:26 +0330 Subject: [PATCH] Changing the input arguments of the defaultSort function for more power in the input of this function --- src/Concerns/SortsQuery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Concerns/SortsQuery.php b/src/Concerns/SortsQuery.php index 469177ed..0b4dd6f8 100644 --- a/src/Concerns/SortsQuery.php +++ b/src/Concerns/SortsQuery.php @@ -36,7 +36,9 @@ public function allowedSorts($sorts): static */ public function defaultSort($sorts): static { - return $this->defaultSorts(func_get_args()); + $sorts = is_array($sorts) ? $sorts : func_get_args(); + + return $this->defaultSorts($sorts); } /**