Skip to content

Name of current Route #192

Answered by mychidarko
henry5059 asked this question in Q&A
Apr 22, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hi @henry5059. You can call getRoute on the Leaf instance to get the current route:

$route = app()->getRoute();

This will return an array containing the route path and method. You can access the route path using ['path']

$route = app()->getRoute();
$routePath = $route['path'];

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@henry5059
Comment options

@henry5059
Comment options

@mychidarko
Comment options

Answer selected by mychidarko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants