StocksNew/app/Helpers/RouteHelper.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

20 lines
674 B
PHP

<?php
function getRouteList()
{
$routes = Route::getRoutes();
$ignoreRoutes = ['debugbar', 'login', 'register', 'logout', 'post', 'sanctum', 'ignition', 'unisharp', 'errorpage', 'form7', 'master', 'hr', 'setting', 'nepalidictonary', 'api'];
$routeNameArr = [];
foreach ($routes as $value) {
if (!is_null($value)) {
$routeName = explode('.', $value->getName());
if (is_array($routeName) && !empty($routeName[0])) {
if (!in_array($routeName[0], $ignoreRoutes)) {
$routeNameArr[$routeName[0]][] = $value->getName();
}
}
}
}
return $routeNameArr;
}