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'; + } +}