Skip to content

Commit

Permalink
🔧 get a named route through url() helper function
Browse files Browse the repository at this point in the history
Signed-off-by: otengkwame <[email protected]>
  • Loading branch information
otengkwame committed Mar 2, 2024
1 parent 9741243 commit 553fe9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/helpers/ci_core_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ function url($uri = '', $param = '', $protocol = null)
return void_url();
}

if (Route::getName($uri)) {
return route()->named($uri);
}

// Detect if the $uri is string and starts with 'https://' or 'http://'
if (is_string ($uri) && (strpos($uri, 'https://') === 0 || strpos($uri, 'http://') === 0)) {
return $uri . $param;
Expand Down

0 comments on commit 553fe9d

Please sign in to comment.