Skip to content

Commit

Permalink
perbaikan fungsi
Browse files Browse the repository at this point in the history
  • Loading branch information
totoprayogo1916 committed Dec 3, 2023
1 parent 18b5f53 commit 6f3b8a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions donjo-app/helpers/donjolib_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ function url_to(string $route_name, ...$args): string
}

if (! function_exists('route_to')) {
function route_to(string $route_name, ...$args): string
function route_to(string $route_name, ...$args)
{
return uri_string(route($route_name, $args));
$route = route($route_name, $args);
$urlParts = parse_url($route);

if ($urlParts !== false && isset($urlParts['path'])) {
return trim($urlParts['path'], '/');
}

return $route;
}
}

Expand Down

0 comments on commit 6f3b8a7

Please sign in to comment.