From 38cfe68c1bbd4c39e8e91812fec83f036a1f5d3d Mon Sep 17 00:00:00 2001 From: mina-esn Date: Mon, 17 Aug 2026 10:00:22 +0330 Subject: [PATCH] feat: add helper file --- app/helpers/helper.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/helpers/helper.php diff --git a/app/helpers/helper.php b/app/helpers/helper.php new file mode 100644 index 0000000..880b29d --- /dev/null +++ b/app/helpers/helper.php @@ -0,0 +1,23 @@ +query(), ['sort' => $sortKey]); + } +} + +if (!function_exists('activeSort')) { + function activeSort(string $sortKey, string $default = ''): string + { + $currentSort = request()->query('sort', $default); + + + if ($currentSort === $sortKey) { + return 'bg-blue-500 text-white font-DanaMedium'; + } + + return 'text-gray-600 dark:text-gray-300 hover:text-blue-500'; + } +}