feat: add enums and helper functions

This commit is contained in:
2026-08-16 16:58:00 +03:30
parent 497aa161a7
commit f50031393e
+19
View File
@@ -0,0 +1,19 @@
<?php
function ActiveAdminSidebar(array $routes): string
{
$currentRouteName = Route::currentRouteName();
if (in_array($currentRouteName, $routes)) {
return 'active';
}
// برای مسیرهایی که پیشوند دارند (مثلاً admin.tours.*)
foreach ($routes as $route) {
if ($currentRouteName && str_starts_with($currentRouteName, $route . '.')) {
return 'active';
}
}
return '';
}